René's URL Explorer Experiment


Title: Unknown methods return -32602 Invalid params instead of -32601 Method not found · Issue #3193 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Unknown methods return -32602 Invalid params instead of -32601 Method not found · Issue #3193 · modelcontextprotocol/python-sdk

X Title: Unknown methods return -32602 Invalid params instead of -32601 Method not found · Issue #3193 · modelcontextprotocol/python-sdk

Description: A server built on this SDK answers every unknown JSON-RPC method with -32602 Invalid request parameters, where JSON-RPC 2.0 requires -32601 Method not found. Why it matters Catalogue scanners probe for optional capabilities and read the ...

Open Graph Description: A server built on this SDK answers every unknown JSON-RPC method with -32602 Invalid request parameters, where JSON-RPC 2.0 requires -32601 Method not found. Why it matters Catalogue scanners probe...

X Description: A server built on this SDK answers every unknown JSON-RPC method with -32602 Invalid request parameters, where JSON-RPC 2.0 requires -32601 Method not found. Why it matters Catalogue scanners probe...

Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/3193

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unknown methods return -32602 Invalid params instead of -32601 Method not found","articleBody":"A server built on this SDK answers **every** unknown JSON-RPC method with `-32602 Invalid request parameters`, where JSON-RPC 2.0 requires `-32601 Method not found`.\n\n## Why it matters\n\nCatalogue scanners probe for optional capabilities and read the error code to decide whether a method is unsupported or genuinely malformed. Smithery, scanning our production server, logged:\n\n```\nWarning: Failed to list triggers: MCP error -32602: Invalid request parameters\n```\n\n`-32602` reads as \"you called it wrong\", so the sensible client behaviour is to retry with different parameters — but no parameters will ever work, because the method does not exist. `-32601` is the answer that lets a client move on.\n\n## Reproduction\n\nAgainst any server on this SDK, after `initialize` + `notifications/initialized`:\n\n```json\n{\"jsonrpc\":\"2.0\",\"id\":9,\"method\":\"totally/bogus\"}\n```\n\nResponse:\n\n```json\n{\"jsonrpc\":\"2.0\",\"id\":9,\"error\":{\"code\":-32602,\"message\":\"Invalid request parameters\",\"data\":\"\"}}\n```\n\nSame code for `triggers/list`, `completions/complete` and `logging/setLevel` on a server that declares none of those capabilities — the four are indistinguishable from a genuine schema violation.\n\n## Cause\n\nIn `mcp/shared/session.py`, `self._receive_request_type.model_validate(...)` raises for a method outside the request union, and the surrounding `except Exception` maps everything to `INVALID_PARAMS`:\n\n```python\nexcept Exception as e:\n    # For request validation errors, send a proper JSON-RPC error\n    # response instead of crashing the server\n    logging.warning(f\"Failed to validate request: {e}\")\n    error_response = JSONRPCError(\n        ...\n        error=ErrorData(code=INVALID_PARAMS, message=\"Invalid request parameters\", data=\"\"),\n    )\n```\n\nThe comment is accurate for its original purpose — the union is just doing double duty as a method registry, so \"method I do not have\" and \"parameters I cannot parse\" arrive at the same handler.\n\n## Suggested fix\n\nDistinguish the two before building the error: if `message.message.root.method` is not among the known request methods, answer `METHOD_NOT_FOUND` and keep `INVALID_PARAMS` for a known method that fails validation. Populating `data` with the validation error would also help — it is currently an empty string, so the response carries no diagnostic at all.\n\nHappy to open a PR if the approach looks right.\n\nObserved on `mcp` 1.27.1, Python 3.14.","author":{"url":"https://github.com/borisowvalia","@type":"Person","name":"borisowvalia"},"datePublished":"2026-07-27T21:51:02Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/3193"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5422a454-c137-3b37-e78d-ed49cc729cee
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE302:25C00B:310D727:405E98D:6B0575C2
html-safe-nonce747aabf1e649ba4b7a01e5968397466d3bffe24d749822e2675489b25a4591aa
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzAyOjI1QzAwQjozMTBENzI3OjQwNUU5OEQ6NkIwNTc1QzIiLCJ2aXNpdG9yX2lkIjoiNjIzMTQ0Nzk3NzE2MTIyNTY2NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac79e0bb2c0a969f07f0dcc4d6ba5a8032d084da929812de74346518086f23fdb7
hovercard-subject-tagissue:4992630215
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/3193/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1a3a471c471289af04f51f9394315c636a01455a3c0b06e66f306fe064bfe8a9/modelcontextprotocol/python-sdk/issues/3193
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1a3a471c471289af04f51f9394315c636a01455a3c0b06e66f306fe064bfe8a9/modelcontextprotocol/python-sdk/issues/3193
og:image:altA server built on this SDK answers every unknown JSON-RPC method with -32602 Invalid request parameters, where JSON-RPC 2.0 requires -32601 Method not found. Why it matters Catalogue scanners probe...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameborisowvalia
hostnamegithub.com
expected-hostnamegithub.com
None507b2d62524c0f595c35a2a2ee8a6ec54b119f245b3c59eaa070013b70ed1ada
turbo-cache-controlno-preview
go-importgithub.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862584018
octolytics-dimension-repository_nwomodelcontextprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862584018
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/python-sdk
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee7a883ae3b439b8952652eaa7803e2587f30e339
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/3193#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F3193
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F3193
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3193
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3193
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3193
modelcontextprotocolhttps://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Codehttps://github.com/modelcontextprotocol/python-sdk
Issues320 (320)https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests112 (112)https://github.com/modelcontextprotocol/python-sdk/pulls
Actionshttps://github.com/modelcontextprotocol/python-sdk/actions
Projectshttps://github.com/modelcontextprotocol/python-sdk/projects
Security and quality12 (12)https://github.com/modelcontextprotocol/python-sdk/security
Insightshttps://github.com/modelcontextprotocol/python-sdk/insights
https://github.com/modelcontextprotocol/python-sdk
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3193
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3193
Unknown methods return -32602 Invalid params instead of -32601 Method not foundhttps://github.com/modelcontextprotocol/python-sdk/issues/3193#top
v1https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v1%22
https://github.com/borisowvalia
borisowvaliahttps://github.com/borisowvalia
on Jul 27, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3193#issue-4992630215
https://github.com/Ben-Home
Ben-Homehttps://github.com/Ben-Home
on Jul 28, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3193#issuecomment-5107261771
https://github.com/Pradhyut21
Pradhyut21https://github.com/Pradhyut21
on Jul 29, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3193#issuecomment-5115160046
@borisowvaliahttps://github.com/borisowvalia
Pradhyut21https://github.com/Pradhyut21
on Jul 29, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3193#event-28650741637
fix(server): return METHOD_NOT_FOUND for unregistered spec methods (m…https://github.com/Pradhyut21/python-sdk/commit/9724ceab0f1557b520dee5cf9be1c33743e85ffa
m…https://github.com/modelcontextprotocol/python-sdk/issues/3193
9724ceahttps://github.com/Pradhyut21/python-sdk/commit/9724ceab0f1557b520dee5cf9be1c33743e85ffa
https://github.com/borisowvalia
borisowvaliahttps://github.com/borisowvalia
on Jul 29, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3193#issuecomment-5116732280
#2372https://github.com/modelcontextprotocol/python-sdk/pull/2372
#1561https://github.com/modelcontextprotocol/python-sdk/issues/1561
https://github.com/Ranga-Prasath-22
Ranga-Prasath-22https://github.com/Ranga-Prasath-22
on Jul 29, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3193#issuecomment-5117746202
@borisowvaliahttps://github.com/borisowvalia
https://github.com/maxisbey
maxisbeyhttps://github.com/maxisbey
on Jul 29, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3193#issuecomment-5118423523
maxisbeyhttps://github.com/maxisbey
completedhttps://github.com/modelcontextprotocol/python-sdk/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 29, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3193#event-28662968770
https://github.com/Ecocitizenz
Ecocitizenzhttps://github.com/Ecocitizenz
on Jul 29, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3193#issuecomment-5121640032
claudehttps://github.com/apps/claude
v1https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v1%22
on Sep 30, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3193#event-32187829422
Sign up for freehttps://github.com/signup?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3193
Sign in to commenthttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3193
v1https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v1%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.