Title: OutputSchema support in MCP tools by bzsurbhi · Pull Request #654 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: OutputSchema support in MCP tools by bzsurbhi · Pull Request #654 · modelcontextprotocol/python-sdk
X Title: OutputSchema support in MCP tools by bzsurbhi · Pull Request #654 · modelcontextprotocol/python-sdk
Description: Add outputSchema support to MCP tools Motivation and Context Implemented changes in PR for outputSchema Key implementation details: Added outputSchema field to the Tool class to store the JSON schema for tool outputs Enhanced func_metadata to extract return type annotations and generate JSON schemas Graceful error handling when schema generation fails (logs warning but doesn't break functionality) How Has This Been Tested? Added tests with tools using various return types including: Simple types (string, int, bool) Complex types (Pydantic models) None return types Collection types (lists, dictionaries) Breaking Changes No breaking changes. The outputSchema is optional and backward compatible with existing tools. Types of changes Bug fix (non-breaking change which fixes an issue) New feature (non-breaking change which adds functionality) Breaking change (fix or feature that would cause existing functionality to change) Documentation update Checklist I have read the MCP Documentation My code follows the repository's style guidelines New and existing tests pass locally I have added appropriate error handling I have added or updated documentation as needed Additional context
Open Graph Description: Add outputSchema support to MCP tools Motivation and Context Implemented changes in PR for outputSchema Key implementation details: Added outputSchema field to the Tool class to store the JSON sch...
X Description: Add outputSchema support to MCP tools Motivation and Context Implemented changes in PR for outputSchema Key implementation details: Added outputSchema field to the Tool class to store the JSON sch...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/654
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:80f3b0c9-00f1-7e58-bdd4-b8bc5909f48e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D0A2:1F5D45:C10688:10539D1:6A5A93D6 |
| html-safe-nonce | e4f2aea91ef69c69344a5a9e9ddd8abbba62e210112b63e1d7358f95c4229283 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMEEyOjFGNUQ0NTpDMTA2ODg6MTA1MzlEMTo2QTVBOTNENiIsInZpc2l0b3JfaWQiOiI0NzMwNzMzMjkyMzYyMDQ0Mzc0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 79cd4bde2e38e95daa2c19ff80597f9eab95c58658fe9c2adbd3aa08628851c8 |
| hovercard-subject-tag | pull_request:2505128947 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/modelcontextprotocol/python-sdk/pull/654/files |
| twitter:image | https://avatars.githubusercontent.com/u/115104450?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/115104450?s=400&v=4 |
| og:image:alt | Add outputSchema support to MCP tools Motivation and Context Implemented changes in PR for outputSchema Key implementation details: Added outputSchema field to the Tool class to store the JSON sch... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9989a1a1d89aa5a38a19e5d0c7ee88a8ffde84acde90048990492aae52f235db |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ba6769fbf719c56dbf7bed650ce454dafc5b1528 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width