Skip to content

mcp: a tool argument that fails the published JSON Schema is refused with a bare -32602 "Input validation error" (no code, no status) that echoes unknown keys verbatim #37411

Backlog

Description

@objectstack-fleet

triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

Triage: lands in area:ai · domain:server · Bug · priority:p3 · pm:queue · size S; rationale: a refusal convention gap on the MCP doors. The caller gets a refusal it can read, and only its own input back, so it is Impeded × developers only (rare configuration), p3.

Filing gate: ① · Source: fleet (found in the review of PR #37393 by the epic #37000 seat, relayed to triage) · reach: every tool on both MCP doors (HTTP and stdio), measured · evidence: measured.

维护者速读

  • 问题:外接 AI 调用工具时,参数不符合工具公布的格式,返回的是 SDK 自带的「Input validation error」,没有平台约定的错误代码,还会把调用方传错的键原样回显(实测一次回显 300 字符、含换行和空字符、列出九个键)。
  • 影响:只影响调用方自己,看到的是自己的输入,不算安全问题;但平台「每个拒绝都带代码」的约定在这条路上不成立,AI 客户端没法按代码处理。
  • 要你做什么:无。低优先级,排队等有人顺手做。

What happens

  • Over MCP, when a tools/call argument fails the tool's published JSON Schema, the SDK's own schema check refuses first with MCP error -32602: Input validation error.
  • The refusal carries no code or status from the platform's coded-refusal convention.
  • It echoes unknown keys verbatim. Measured: 300 characters with a raw newline and NUL, nine keys listed.
  • It applies to every tool on both doors (HTTP and stdio). The top-level case predates PR feat(service-knowledge): search_knowledge takes scope, granularity and groupBy #37393.

Expected

  • A schema refusal on either door carries the platform's coded-refusal shape (a stable code, and the status where the door has one), like the platform's own argument refusals.
  • Unknown keys are named in bounded, sanitised form: a capped count, with control characters stripped or escaped.

Done when

  • One test per door sends an argument that fails the schema (a wrong type and unknown keys) and asserts the coded refusal and the bounded key echo.
  • The behaviour is the same on HTTP and stdio.

Notes

Activity

  1. added
    bug
    pm:queue
    finding
    area:ai
    domain:server
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:aibugdomain:serverfindingpm:queuepriority:p3

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions