Skip to content

fix(mcp): a guessed tool name through call_tool is no Sentry issue - #112

Merged
Ooscaar merged 1 commit into
developfrom
fix/mcp-unknown-tool-telemetry
Nov 18, 2026
Merged

Ooscaar merged 1 commit into
developfrom
fix/mcp-unknown-tool-telemetry

Conversation

@Ooscaar

@Ooscaar Ooscaar commented Nov 18, 2026

Copy link
Copy Markdown
Member

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_forms is 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_tool now checks the name itself and wraps its NotFoundError in a ToolError. is_expected_failure accepts a wrapped LateError or FastMCPError, but in FastMCP 4 NotFoundError isn't a FastMCPError. 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_failure also accepts a wrapped NotFoundError. That function feeds both the Sentry report and the production log filter, so one change fixes both.

Testing

  • New test test_a_guessed_name_through_call_tool_opens_no_sentry_issue: a guessed name through call_tool sends no Sentry event and writes no log record. It fails without the fix.
  • The existing tests that make sure real bugs still reach Sentry pass.
  • Full suite: 3254 passed on Python 3.11, 3.12 and 3.14. On 3.10, the 1363 non-MCP tests pass. No new lint findings.
  • Locally the agent still gets the "Closest tools" hint for lead_gen_list_forms.

After deploy, ZERNIO-MCP-S should get no new events, and it can be resolved.

🤖 Generated with Claude Code

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>
@Ooscaar
Ooscaar merged commit dc230d8 into develop Nov 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant