go-sdk/mcp/testdata/conformance/server
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ravish Gupta 74d2751d88
mcp: return input validation errors as tool results, not JSON-RPC errors (#863)
This implements [SEP-1303](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1303).

Input validation errors (missing required fields, wrong types) during
tool calls
are now returned as `CallToolResult` with `IsError=true` instead of
JSON-RPC
`-32602` errors. This allows LLMs to see the validation error and
self-correct,
  per the MCP spec.
The existing pattern for handler-returned errors (lines 347-350 in
server.go)
already converts regular errors to tool results with `IsError=true`.
This change
applies the same pattern to argument schema validation and unmarshal
errors,
  resolving the `TODO(#450)` in the code.                   

Thanks to @iwyrkore for filing the issue and proposing the approach, and
  @findleyr for the cross-SDK analysis in the discussion.
  Fixes #450

Co-authored-by: Maciej Kisiel <mkisiel@google.com>
2026-03-31 10:14:36 +02:00
..
bad_requests.txtar mcp: don't mark the server sesion as initialized prematurely 2025-08-07 14:59:36 -04:00
lifecycle.txtar mcp: allow requests before notifications/initialized 2025-09-05 12:04:58 -04:00
prompts.txtar mcp: don't mark the server sesion as initialized prematurely 2025-08-07 14:59:36 -04:00
resources.txtar mcp: don't mark the server sesion as initialized prematurely 2025-08-07 14:59:36 -04:00
spec-sep-973-additional-metadata.txtar go.mod: upgrade to jsonschema v0.4.2 (#732) 2026-01-04 09:18:01 -05:00
tools.txtar mcp: return input validation errors as tool results, not JSON-RPC errors (#863) 2026-03-31 10:14:36 +02:00
version-latest.txtar mcp: update latestProtocolVersion to 2025-11-25 (#724) 2026-03-03 10:30:11 +01:00
version-older.txtar mcp/server: advertise completions only if installed (#213) 2025-08-04 10:12:01 -04:00