fix: tools-call-simple-text now fails when tool returns isError: true#165
Open
lux999 wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
fix: tools-call-simple-text now fails when tool returns isError: true#165lux999 wants to merge 1 commit intomodelcontextprotocol:mainfrom
lux999 wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added an
isErrorcheck toToolsCallSimpleTextScenario, so the testtools-call-simple-textcorrectly fails when the tool returns an error result instead of a successful text response.Motivation and Context
The test
tools-call-simple-textwas passing for servers that don't implementtest_simple_textat all.When an unknown tool is called, MCP frameworks return
{ isError: true, content: [{ type: "text", text: "Tool not found: ..." }] }. The existing assertions only checked for a non-empty text content item, which the "Tool not found" error message satisfies. The missing assertion was thatresult.isErrormust not be true.How Has This Been Tested?
Verified against the existing everything-server reference implementation, which correctly implements
test_simple_textand continues to pass. Confirmed that servers withouttest_simple_textnow correctly fail the test.Breaking Changes
Servers that were previously passing
tools-call-simple-textwithout implementingtest_simple_textwill now correctly fail.Types of changes
Checklist
Additional context