Repository navigation
fix(mcp): tool calls rejected for their arguments log as InvalidArguments, with the failing fields - #119
Merged
Conversation
…ents, with the failing fields
FastMCP raises its own ValidationError for arguments it rejects before the
tool runs, and the telemetry named it after its pydantic cause, the same
name an SDK model rejecting an API response gets. 30k "ValidationError"
calls in zernio-mcp could not be told apart, and FastMCP 4's warning no
longer names the field.
- error_type InvalidArguments plus invalid_arguments ("status:
literal_error, ..."), never the values, in the mcp_tool_call line and as
Sentry transaction tags (mcp.error_type, mcp.invalid_arguments).
- A response a model rejects inside a hand-written tool logs ValidationError
again instead of FastMCP 4's _ToolBodyError.
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.
Why
A tool call FastMCP rejects for its arguments (never reaching the API) was logged as
ValidationError, the same name an SDK model rejecting an API response gets, and FastMCP 4's warning no longer names the field. The ~30kValidationErrorrows inzernio-mcp(Nov 10-19) could not be told apart, and finding thenot_deleted/metarejections fixed in #116 and #117 meant digging through old Railway deployments. Sentry never sees them (expected failures).What
error_type: "InvalidArguments"plusinvalid_arguments("status: literal_error, platform: literal_error"), field and error type only, never values, in themcp_tool_callline.mcp.error_typeandmcp.invalid_argumentstags; still no Sentry issue for them.accounts_list) logsValidationErroragain instead of FastMCP 4's_ToolBodyError.Validated locally on the real server with the API mocked:
platform=metalogsInvalidArguments/platform: literal_error(wasValidationError),include_hiddenlogsinclude_hidden: unexpected_keyword_argument, API 400s keepLateAPIError+status_code, a rejected response logsValidationError(was_ToolBodyError). Full suite: 3311 passed.Follow-ups
zernio-mcprows that readerror_type == "ValidationError"becomeInvalidArguments. Check any Axiom query, dashboard or alert on that value.🤖 Generated with Claude Code