You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
2025-11-25 Tool.inputSchema/outputSchema reject boolean sub-schemas in properties, failing the whole tools/list #3353
JSON Schema 2020-12 allows a boolean (true / false) anywhere a sub-schema is expected, including as a value under properties. The generated 2025-11-25 wire model types properties as dict[str, dict[str, Any]] on both InputSchema and OutputSchema (src/mcp-types/mcp_types/_v2025_11_25/__init__.py, lines 1361 and 1379), so a tool whose outputSchema contains e.g. "properties": {"result": true} fails surface validation with a pydantic dict_type error.
Because ListToolsResult is validated as a whole, one such tool causes the client to discard the entire tool list for that server on any 2025-11-25-negotiated session (same failure shape as #3337, different trigger).
This is not hypothetical: a publicly reachable server (Microsoft's Azure Resource Manager MCP, https://mcp.management.azure.com) currently returns tools/list where 12 of 17 tools carry
and the SDK cannot list any of its tools on a 2025-11-25 session.
The 2026-07-28 surface already accepts this payload: its InputSchema/OutputSchema have no typed properties field (SEP-2106, #2792, made both free-form JSON Schema 2020-12). The 2025-11-25 strictness is an artefact of how schema.ts rendered { [key: string]: object } to JSON, not something the 2025-11-25 spec text requires — that spec also says outputSchema is a JSON Schema object and defaults to the 2020-12 dialect.
Expected:validate_server_result("tools/list", "2025-11-25", ...) accepts boolean property sub-schemas (and the client's list_tools() succeeds), matching 2026-07-28 behaviour and JSON Schema 2020-12.
Proposed fix (happy to open the PR): extend the existing SCHEMA_PATCHES["2025-11-25"] list in scripts/gen_surface_types.py to widen $defs/Tool/properties/{inputSchema,outputSchema}/properties/properties/additionalProperties to anyOf: [<object>, {"type": "boolean"}], then regenerate. The generated diff is exactly two lines (dict[str, dict[str, Any]] → dict[str, dict[str, Any] | bool]) and the 2026-07-28 module is unchanged. Plus a regression test in tests/types/test_methods.py.
Output (identical on the released mcp==2.0.0 wheel and on main @ 57394b0):
2026-07-28: ok
Traceback (most recent call last):
...
pydantic_core._pydantic_core.ValidationError: 1 validation error for ListToolsResult
tools.0.outputSchema.properties.result
Input should be a valid dictionary [type=dict_type, input_value=True, input_type=bool]
For further information visit https://errors.pydantic.dev/2.12/v/dict_type
Python & MCP Python SDK
Python 3.13.15
mcp 2.0.0 / mcp-types 2.0.0 (latest release, PyPI), pydantic 2.13.4
also reproduces on main @ 57394b05 (mcp 2.0.1.dev21+57394b05), pydantic 2.12.5
Thanks for the detailed report. I reviewed the current main branch and agree that the failure appears to come from the generated 2025-11-25 InputSchema/OutputSchema types: properties currently accepts dict[str, dict[str, Any]], while JSON Schema allows boolean subschemas.
The proposed fix seems appropriately scoped: update the existing SCHEMA_PATCHES["2025-11-25"] code-generation patch, regenerate the surface types, and add a regression test for tools/list with boolean property schemas. I would also verify that the 2026-07-28 behavior remains unchanged.
I am interested in preparing this as a small PR. If this direction is acceptable, please assign the issue to me. I will follow the repository contribution guidelines and disclose the use of AI-assisted coding with manual review.
Activity
z2Ace0107 commentedon Aug 21, 2026
Thanks for the detailed report. I reviewed the current main branch and agree that the failure appears to come from the generated 2025-11-25 InputSchema/OutputSchema types:
propertiescurrently acceptsdict[str, dict[str, Any]], while JSON Schema allows boolean subschemas.The proposed fix seems appropriately scoped: update the existing
SCHEMA_PATCHES["2025-11-25"]code-generation patch, regenerate the surface types, and add a regression test fortools/listwith boolean property schemas. I would also verify that the 2026-07-28 behavior remains unchanged.I am interested in preparing this as a small PR. If this direction is acceptable, please assign the issue to me. I will follow the repository contribution guidelines and disclose the use of AI-assisted coding with manual review.