Skip to content

fix(mcp): tool calls rejected for their arguments log as InvalidArguments, with the failing fields - #119

Merged
Ooscaar merged 1 commit into
developfrom
fix/mcp-telemetry-invalid-arguments
Nov 19, 2026
Merged

Ooscaar merged 1 commit into
developfrom
fix/mcp-telemetry-invalid-arguments

Conversation

@Ooscaar

@Ooscaar Ooscaar commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

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 ~30k ValidationError rows in zernio-mcp (Nov 10-19) could not be told apart, and finding the not_deleted / meta rejections fixed in #116 and #117 meant digging through old Railway deployments. Sentry never sees them (expected failures).

What

  • Argument rejections log error_type: "InvalidArguments" plus invalid_arguments ("status: literal_error, platform: literal_error"), field and error type only, never values, in the mcp_tool_call line.
  • The Sentry transaction carries mcp.error_type and mcp.invalid_arguments tags; still no Sentry issue for them.
  • A response a model rejects inside a hand-written tool (e.g. accounts_list) logs ValidationError again instead of FastMCP 4's _ToolBodyError.

Validated locally on the real server with the API mocked: platform=meta logs InvalidArguments / platform: literal_error (was ValidationError), include_hidden logs include_hidden: unexpected_keyword_argument, API 400s keep LateAPIError + status_code, a rejected response logs ValidationError (was _ToolBodyError). Full suite: 3311 passed.

Follow-ups

  • After deploy, most zernio-mcp rows that read error_type == "ValidationError" become InvalidArguments. Check any Axiom query, dashboard or alert on that value.

🤖 Generated with Claude Code

…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>
@Ooscaar
Ooscaar merged commit 0833e9b into develop Nov 19, 2026
4 checks passed
@Ooscaar
Ooscaar deleted the fix/mcp-telemetry-invalid-arguments branch November 19, 2026 16:30
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