Title: Prompt validation errors are logged with an unnecessary traceback · Issue #3342 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Prompt validation errors are logged with an unnecessary traceback · Issue #3342 · modelcontextprotocol/python-sdk
X Title: Prompt validation errors are logged with an unnecessary traceback · Issue #3342 · modelcontextprotocol/python-sdk
Description: Initial Checks I confirm that I'm using the newest release of my line (the latest 2.x, or the latest 1.x if I'm still on v1) I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before openi...
Open Graph Description: Initial Checks I confirm that I'm using the newest release of my line (the latest 2.x, or the latest 1.x if I'm still on v1) I confirm that I searched for my issue in https://github.com/modelcontex...
X Description: Initial Checks I confirm that I'm using the newest release of my line (the latest 2.x, or the latest 1.x if I'm still on v1) I confirm that I searched for my issue in https://github.com/mod...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/3342
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Prompt validation errors are logged with an unnecessary traceback","articleBody":"### Initial Checks\n\n- [x] I confirm that I'm using the newest release of my line (the latest 2.x, or the latest 1.x if I'm still on v1)\n- [x] I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue\n\n### Release line\n\n2.x (current stable)\n\n### Description\n\n## Description\n\nWhen a prompt is called without a required argument, the request is correctly rejected, but the Python SDK logs the validation error with a full traceback.\n\n## To Reproduce\n\nSteps to reproduce the behavior:\n\n1. Create a prompt with a required argument:\n\n ```python\n @mcp.prompt()\n def diagnose_cluster(problem: str) -> str:\n return f\"Diagnose: {problem}\"\n ```\n\n2. Call `prompts/list` and confirm that `problem` is marked as required.\n\n3. Call `prompts/get` without providing the required argument:\n\n ```json\n {\n \"method\": \"prompts/get\",\n \"params\": {\n \"name\": \"diagnose_cluster\"\n }\n }\n ```\n\n4. The request is rejected, but the server logs a full traceback:\n\n ```text\n Error getting prompt diagnose_cluster\n Traceback (most recent call last):\n ...\n File \".../mcp/server/mcpserver/server.py\", line 1285, in get_prompt\n rendered = await prompt.render(arguments, context)\n File \".../mcp/server/mcpserver/prompts/base.py\", line 160, in render\n raise ValueError(f\"Missing required arguments: {missing}\")\n ValueError: Missing required arguments: {'problem'}\n\n handler for 'prompts/get' raised\n ```\n\n\n### Example Code\n\n```Python\n\n```\n\n### Python & MCP Python SDK\n\n```Text\n## Environment\n\n- MCP Python SDK: v2\n- Python: 3.x\n- Server: `MCPServer`\n- Prompt transport: Streamable HTTP\n```","author":{"url":"https://github.com/rookie-z","@type":"Person","name":"rookie-z"},"datePublished":"2026-08-20T09:16:21Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/3342"}
| 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:7b60af5a-d0c8-d2e8-9497-04fe6831d495 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B786:3ED092:136FAB:1B24D0:6B057BA0 |
| html-safe-nonce | 1e615b05387db5fbad049a2776424a5966119b5dc483fc9f5ce67ea43889f118 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzg2OjNFRDA5MjoxMzZGQUI6MUIyNEQwOjZCMDU3QkEwIiwidmlzaXRvcl9pZCI6Ijg3NTcyMjkzMTY2NDA5NjM0ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6a66b7d5be58f654e99feeb0b5323e42f462f1860ee0a526d4ca169c232726d6 |
| hovercard-subject-tag | issue:5201781878 |
| 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/3342/issue_layout |
| twitter:image | https://opengraph.githubassets.com/23272027af8ca71921f275b64e84ae09e5035d4da7085ede8bd5f963e0416f64/modelcontextprotocol/python-sdk/issues/3342 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/23272027af8ca71921f275b64e84ae09e5035d4da7085ede8bd5f963e0416f64/modelcontextprotocol/python-sdk/issues/3342 |
| og:image:alt | Initial Checks I confirm that I'm using the newest release of my line (the latest 2.x, or the latest 1.x if I'm still on v1) I confirm that I searched for my issue in https://github.com/modelcontex... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rookie-z |
| hostname | github.com |
| expected-hostname | github.com |
| None | 507b2d62524c0f595c35a2a2ee8a6ec54b119f245b3c59eaa070013b70ed1ada |
| 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 | e7a883ae3b439b8952652eaa7803e2587f30e339 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width