claude-code - 💡(How to fix) Fix MCP error -32602: missing field 'id' when deferred-schema tool arguments contain non-ASCII UTF-8 characters

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When invoking a deferred-schema MCP tool (one that requires ToolSearch before use) with parameter values containing non-ASCII UTF-8 characters (German umlauts, €, §, etc.), the entire arguments object is dropped from the JSON-RPC tools/call request. The MCP server receives arguments: null, which it correctly reports as a missing required field — producing the misleading error:

MCP error -32602: failed to deserialize parameters: missing field `id`

Error Message

When invoking a deferred-schema MCP tool (one that requires ToolSearch before use) with parameter values containing non-ASCII UTF-8 characters (German umlauts, €, §, etc.), the entire arguments object is dropped from the JSON-RPC tools/call request. The MCP server receives arguments: null, which it correctly reports as a missing required field — producing the misleading error: MCP error -32602: failed to deserialize parameters: missing field id MCP error -32602: failed to deserialize parameters: missing field id The error missing field 'id' is produced when arguments is None (no arguments received), which unwrap_or_default() converts to {}. Deserializing {} into a struct with a required id field produces exactly this error.

Root Cause

Traced the server-side call chain in rmcp 1.7.0 (handler/server/tool.rs:186):

let arguments = context.arguments.take().unwrap_or_default();
serde_json::from_value(serde_json::Value::Object(arguments)).map_err(|e| {
    ErrorData::invalid_params(format!("failed to deserialize parameters: {}", e), None)
})

The error missing field 'id' is produced when arguments is None (no arguments received), which unwrap_or_default() converts to {}. Deserializing {} into a struct with a required id field produces exactly this error.

The server receives a syntactically valid JSON-RPC message, but with arguments: null or the arguments key absent. The server-side Rust/serde_json/rmcp stack handles UTF-8 correctly and is not the cause.

The defect is in the client-side deferred-schema tool invocation path: when Claude Code constructs the tools/call JSON-RPC message after fetching a schema via ToolSearch, the arguments serialization step drops the parameter object entirely if any string value contains multi-byte UTF-8 codepoints.

This does not reproduce with non-deferred tools (tools whose schema is available without a prior ToolSearch call).

Fix Action

Workaround

Replace all non-ASCII characters with ASCII equivalents before passing string values. Functional but typographically incorrect.

Code Example

MCP error -32602: failed to deserialize parameters: missing field `id`

---

{
  "id": 7976,
  "custom_fields": [
    {"field": 5, "value": "Verspätungszuschläge zur Gewerbesteuer (925,00 €) nach § 227 AO"}
  ]
}

---

MCP error -32602: failed to deserialize parameters: missing field `id`

---

{
  "id": 7976,
  "custom_fields": [
    {"field": 5, "value": "Verspaetungszuschlaege zur Gewerbesteuer (925,00 EUR) nach Paragraph 227 AO"}
  ]
}

---

let arguments = context.arguments.take().unwrap_or_default();
serde_json::from_value(serde_json::Value::Object(arguments)).map_err(|e| {
    ErrorData::invalid_params(format!("failed to deserialize parameters: {}", e), None)
})
RAW_BUFFERClick to expand / collapse

Summary

When invoking a deferred-schema MCP tool (one that requires ToolSearch before use) with parameter values containing non-ASCII UTF-8 characters (German umlauts, €, §, etc.), the entire arguments object is dropped from the JSON-RPC tools/call request. The MCP server receives arguments: null, which it correctly reports as a missing required field — producing the misleading error:

MCP error -32602: failed to deserialize parameters: missing field `id`

Environment

  • Client: Claude Code (claude-sonnet-4-6)
  • MCP server: mcp__paperless (stdio transport, Rust/rmcp 1.7.0)
  • Tool schema loading: Deferred — schema fetched via ToolSearch before invocation

Steps to reproduce

  1. Use a tool that requires ToolSearch to load its schema (a deferred tool).
  2. Invoke it with a string parameter value containing non-ASCII characters, e.g.:
{
  "id": 7976,
  "custom_fields": [
    {"field": 5, "value": "Verspätungszuschläge zur Gewerbesteuer (925,00 €) nach § 227 AO"}
  ]
}

Expected: Tool executes normally; UTF-8 string stored verbatim.

Actual:

MCP error -32602: failed to deserialize parameters: missing field `id`
  1. Repeat the identical call with all non-ASCII characters replaced by ASCII equivalents:
{
  "id": 7976,
  "custom_fields": [
    {"field": 5, "value": "Verspaetungszuschlaege zur Gewerbesteuer (925,00 EUR) nach Paragraph 227 AO"}
  ]
}

Result: Call succeeds.

Root cause analysis

Traced the server-side call chain in rmcp 1.7.0 (handler/server/tool.rs:186):

let arguments = context.arguments.take().unwrap_or_default();
serde_json::from_value(serde_json::Value::Object(arguments)).map_err(|e| {
    ErrorData::invalid_params(format!("failed to deserialize parameters: {}", e), None)
})

The error missing field 'id' is produced when arguments is None (no arguments received), which unwrap_or_default() converts to {}. Deserializing {} into a struct with a required id field produces exactly this error.

The server receives a syntactically valid JSON-RPC message, but with arguments: null or the arguments key absent. The server-side Rust/serde_json/rmcp stack handles UTF-8 correctly and is not the cause.

The defect is in the client-side deferred-schema tool invocation path: when Claude Code constructs the tools/call JSON-RPC message after fetching a schema via ToolSearch, the arguments serialization step drops the parameter object entirely if any string value contains multi-byte UTF-8 codepoints.

This does not reproduce with non-deferred tools (tools whose schema is available without a prior ToolSearch call).

Impact

Any document or entity whose natural-language metadata contains non-ASCII text (German, French, Spanish, CJK, currency symbols, legal symbols, etc.) cannot be updated via deferred MCP tools without manual ASCII transliteration. This is a significant regression for non-English workflows.

Workaround

Replace all non-ASCII characters with ASCII equivalents before passing string values. Functional but typographically incorrect.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix MCP error -32602: missing field 'id' when deferred-schema tool arguments contain non-ASCII UTF-8 characters