Title: Mcp-Param-* validation runs the full tools/list handler on every tools/call · Issue #3565 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Mcp-Param-* validation runs the full tools/list handler on every tools/call · Issue #3565 · modelcontextprotocol/python-sdk
X Title: Mcp-Param-* validation runs the full tools/list handler on every tools/call · Issue #3565 · modelcontextprotocol/python-sdk
Description: Description On the 2026-07-28 HTTP path, every tools/call with arguments runs the server's full tools/list handler before dispatch, to find the called tool's inputSchema for Mcp-Param-* validation (_mcp_param_rejection → _tool_input_sche...
Open Graph Description: Description On the 2026-07-28 HTTP path, every tools/call with arguments runs the server's full tools/list handler before dispatch, to find the called tool's inputSchema for Mcp-Param-* validation ...
X Description: Description On the 2026-07-28 HTTP path, every tools/call with arguments runs the server's full tools/list handler before dispatch, to find the called tool's inputSchema for Mcp-Param-* val...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/3565
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Mcp-Param-* validation runs the full tools/list handler on every tools/call","articleBody":"### Description\n\nOn the `2026-07-28` HTTP path, every `tools/call` with arguments runs the server's full `tools/list` handler before dispatch, to find the called tool's `inputSchema` for `Mcp-Param-*` validation (`_mcp_param_rejection` → `_tool_input_schema`, added in #3033). There is no way to opt out, and it runs even when no tool declares `x-mcp-header`.\n\nFor a server whose `tools/list` is expensive this is a large per-call cost. We run a gateway that aggregates ~7 backend MCP servers; its `tools/list` fans out to every backend with per-user credentials, so each `tools/call` now lists every backend. #3033 notes this cost as \"optimizable later\"; a by-name schema lookup, or skipping the check when no tool declares `x-mcp-header`, would avoid it.\n\nExpected: a `tools/call` doesn't invoke the `tools/list` handler (or there's a way to avoid it). Actual: one full listing per `tools/call`.\n\n### Example Code\n\n```python\nimport asyncio\nimport threading\nimport time\n\nimport uvicorn\nfrom mcp import types\nfrom mcp.client.client import Client\nfrom mcp.server.lowlevel.server import Server\n\nlist_calls = 0\n\n\nasync def on_list_tools(ctx, params):\n global list_calls\n list_calls += 1\n return types.ListToolsResult(\n tools=[\n types.Tool(\n name=\"echo\",\n inputSchema={\"type\": \"object\", \"properties\": {\"text\": {\"type\": \"string\"}}},\n )\n ]\n )\n\n\nasync def on_call_tool(ctx, params):\n # How many times tools/list ran before this call was dispatched.\n return types.CallToolResult(content=[types.TextContent(type=\"text\", text=str(list_calls))])\n\n\nserver = Server(\"repro\", on_list_tools=on_list_tools, on_call_tool=on_call_tool)\napp = server.streamable_http_app(stateless_http=True, json_response=True)\nthreading.Thread(\n target=uvicorn.Server(uvicorn.Config(app, port=8765, log_level=\"warning\")).run, daemon=True\n).start()\ntime.sleep(1)\n\n\nasync def main():\n async with Client(\"http://127.0.0.1:8765/mcp\", mode=\"2026-07-28\") as client:\n result = await client.call_tool(\"echo\", {\"text\": \"hi\"})\n print(f\"tools/list calls before the tools/call was dispatched: {result.content[0].text}\")\n\n\nasyncio.run(main())\n```\n\nPrints `1`. With `mode=\"legacy\"` it prints `0`.\n\n### Python & MCP Python SDK\n\nPython 3.12.13, mcp 2.2.0\n\nRelated: #3513 (client-side analog), #3484.\n\nDrafted with AI assistance (Claude Code); the reproduction above was run against mcp 2.2.0.\n","author":{"url":"https://github.com/kratsg","@type":"Person","name":"kratsg"},"datePublished":"2026-09-23T04:51:59Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/3565"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c98fd105-9c32-f7fb-4a38-84c5d736ccc4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8136:363D8E:16B48D9:1CEAEF0:6B012182 |
| html-safe-nonce | 6af414ea6af587087b4878e9be70e710489950dae48daf3a96c68a737f7fe09d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTM2OjM2M0Q4RToxNkI0OEQ5OjFDRUFFRjA6NkIwMTIxODIiLCJ2aXNpdG9yX2lkIjoiNDc1MjY4OTg3Mzg1OTcxNTQ1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 85648802c99bdec2b8a0eb59d72be2fb47317e04939d0b9c66ee144e24696581 |
| hovercard-subject-tag | issue:5548938804 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/3565/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a232d0cf92804ac8d1e8104e7df907e82863be834b37e828316f9250a70b1d84/modelcontextprotocol/python-sdk/issues/3565 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a232d0cf92804ac8d1e8104e7df907e82863be834b37e828316f9250a70b1d84/modelcontextprotocol/python-sdk/issues/3565 |
| og:image:alt | Description On the 2026-07-28 HTTP path, every tools/call with arguments runs the server's full tools/list handler before dispatch, to find the called tool's inputSchema for Mcp-Param-* validation ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kratsg |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width