Repository navigation
fix(tools-call-error): fail as untestable when test_error_handling is not advertised - #607
Open
seedfunded wants to merge 1 commit into
Open
seedfunded wants to merge 1 commit into
seedfunded wants to merge 1 commit into
Conversation
… not advertised Previously, tools-call-error called tools/call directly and accepted any CallToolResult with isError: true and text content. Against a server that does not implement test_error_handling, SDKs returning a "tool not found" CallToolResult with isError: true caused a false positive. Check paginated tools/list first and report untestableCheck (FAILURE) per issue modelcontextprotocol#248 when test_error_handling is missing, while preserving compatibility with servers whose test_error_handling fixture returns any non-empty error text. Fixes modelcontextprotocol#604
This branch has not been deployed
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.
Summary
Fixes #604.
Previously,
ToolsCallErrorScenariocalledtools/callfortest_error_handlingdirectly and accepted anyCallToolResultwithisError: trueand text content. Against a server that does not implementtest_error_handling, SDKs returning a "tool not found"CallToolResultwithisError: truecausedtools-call-errorto reportSUCCESS.Root-Cause Fix
tools/list(followingnextCursorpagination with a page/cycle guard) before callingtools/call.test_error_handlingis not advertised, reportuntestableCheck(..., 'FAILURE')per Standardize how scenarios report setup/execution failures #248 instead of callingtools/call— avoiding brittle substring matching against specific error prose so compliant SDKs returning custom error text continue to pass.conn.close()runs infinally.Testing
src/scenarios/server/tools.test.tscovering missing fixture (with simulated SDK "tool not found"isError: trueresponse), paginatedtools/list,isError: false, whitespace-only error text, andconn.close()on error.npm run check,npm run build, andnpm test(48 test files, 646 tests passing, including liveeverything-serveron2025-11-25and2026-07-28).