Title: Functionality to fetch output schemas as well on list_tools() · Issue #754 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Functionality to fetch output schemas as well on list_tools() · Issue #754 · modelcontextprotocol/python-sdk
X Title: Functionality to fetch output schemas as well on list_tools() · Issue #754 · modelcontextprotocol/python-sdk
Description: Is your feature request related to a problem? Please describe. I was working on a project and was wondering if it was possible to fetch the output schemas as well on client.list_tools(). I realize that the output returned by MCP tools is...
Open Graph Description: Is your feature request related to a problem? Please describe. I was working on a project and was wondering if it was possible to fetch the output schemas as well on client.list_tools(). I realize ...
X Description: Is your feature request related to a problem? Please describe. I was working on a project and was wondering if it was possible to fetch the output schemas as well on client.list_tools(). I realize ...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/754
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Functionality to fetch output schemas as well on list_tools()","articleBody":"**Is your feature request related to a problem? Please describe.**\nI was working on a project and was wondering if it was possible to fetch the output schemas as well on `client.list_tools()`. I realize that the output returned by MCP tools is often a string (or stringified JSON), and having information in advance about the structure of data I would be receiving would be helpful. \n\n**Describe the solution you'd like**\nCurrently the `list_tools()` returns something like :\n```\n {\n \"meta\": null,\n \"nextCursor\": null,\n \"tools\": [\n {\n \"name\": \"get-news\",\n \"description\": \"Get the latest news for a given topic\",\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"topic\": {\n \"type\": \"string\",\n \"description\": \"Topic to search for\"\n },\n \"page_size\": {\n \"type\": \"number\",\n \"description\": \"Number of results to return (1-25)\"\n }\n },\n \"required\": [\n \"topic\",\n \"page_size\"\n ]\n },\n \"annotations\": null\n },\n {\n \"name\": \"get-headlines\",\n \"description\": \"Get the latest headlines for a given country\",\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"country\": {\n \"type\": \"string\",\n \"description\": \"Country code (2 letters)\"\n },\n \"page_size\": {\n \"type\": \"number\",\n \"description\": \"Number of results to return (1-25)\"\n }\n },\n \"required\": [\n \"country\",\n \"page_size\"\n ]\n },\n \"annotations\": null\n }\n ]\n }\n\n```\nI'd like to also get the output schema for each tool alongside the input schema. If the output is a simple string, then just `{\"type\": \"string\"}` would be fine. But for JSON objects, getting the actual JSON schema being returned before stringification would be very helpful.\n\n**Describe alternatives you've considered**\nCurrent alternatives involve manually reading the MCP server code to determine the exact output schema (this is repetitive for each new MCP server we add) or sending a test request and then parsing the output to infer the schema (not feasible in many cases).\n\nSince I'm using MCP with the client only, I don't have an agent to interpret the output on runtime and utilize that information dynamically.","author":{"url":"https://github.com/PratyushNag","@type":"Person","name":"PratyushNag"},"datePublished":"2025-05-19T13:52:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/754/python-sdk/issues/754"}
| 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:be5e3b77-3bc2-6ce7-90f5-7ed5c99efffd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF50:138FF:1481670:1B77CCC:6A5B88E9 |
| html-safe-nonce | b7e251a206f8a8088601478a76afd08ddb7520fe9de5712c7074b76558fd105c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjUwOjEzOEZGOjE0ODE2NzA6MUI3N0NDQzo2QTVCODhFOSIsInZpc2l0b3JfaWQiOiI4MzcwMjU2NTgxNDg2MTUxOTEzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2ce3e105bb68ef3b0cdc25f7ae6799b50add2082fbc66cd8b94dfd7afc5b1c65 |
| hovercard-subject-tag | issue:3073934269 |
| 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/754/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f2f7a62d2a1556bce617a1589625110f696f3b0ea106acc20ea2a42fb3dded72/modelcontextprotocol/python-sdk/issues/754 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f2f7a62d2a1556bce617a1589625110f696f3b0ea106acc20ea2a42fb3dded72/modelcontextprotocol/python-sdk/issues/754 |
| og:image:alt | Is your feature request related to a problem? Please describe. I was working on a project and was wondering if it was possible to fetch the output schemas as well on client.list_tools(). I realize ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | PratyushNag |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width