Repository navigation
fix(mcp): a guessed tool name through call_tool is no Sentry issue - #112
Merged
Merged
Conversation
FastMCP 4's call_tool checks the name itself and re-wraps its NotFoundError
in a ToolError. is_expected_failure accepted a wrapped LateError or
FastMCPError, but FastMCP 4's NotFoundError is not a FastMCPError, so a
guessed name counted as a bug: Sentry ZERNIO-MCP-S (8 events from Cursor)
and a traceback in the server log. The agent's answer was already right
("Closest tools: ..."); only the reporting was wrong.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
Sentry issue ZERNIO-MCP-S appeared after the FastMCP 4 upgrade (#107): "Error calling tool 'call_tool': Unknown tool: 'lead_gen_list_forms'", 8 events from Cursor.
lead_gen_list_formsis not a real tool. The agent guessed the name, and it already got the right answer: "Unknown tool 'lead_gen_list_forms'. Closest tools: lead_gen_list_lead_forms, …". Only the reporting is wrong.FastMCP 4's
call_toolnow checks the name itself and wraps itsNotFoundErrorin aToolError.is_expected_failureaccepts a wrappedLateErrororFastMCPError, but in FastMCP 4NotFoundErrorisn't aFastMCPError. The guess therefore counted as a bug: it opened a Sentry issue and logged a traceback. In FastMCP 3 the same guess was an expected failure.Fix
is_expected_failurealso accepts a wrappedNotFoundError. That function feeds both the Sentry report and the production log filter, so one change fixes both.Testing
test_a_guessed_name_through_call_tool_opens_no_sentry_issue: a guessed name throughcall_toolsends no Sentry event and writes no log record. It fails without the fix.lead_gen_list_forms.After deploy, ZERNIO-MCP-S should get no new events, and it can be resolved.
🤖 Generated with Claude Code