Title: Inconsistent Field Naming Between `outputSchema` and `model_dump` · Issue #1073 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Inconsistent Field Naming Between `outputSchema` and `model_dump` · Issue #1073 · modelcontextprotocol/python-sdk
X Title: Inconsistent Field Naming Between `outputSchema` and `model_dump` · Issue #1073 · modelcontextprotocol/python-sdk
Description: If the model to return by a tool is defined like: class Foo(BaseModel): field_first: str | None = Field( default=None, alias="first", description="The first field." ) field_second: str | None = Field( default=None, alias="second", descri...
Open Graph Description: If the model to return by a tool is defined like: class Foo(BaseModel): field_first: str | None = Field( default=None, alias="first", description="The first field." ) field_second: str | None = Fie...
X Description: If the model to return by a tool is defined like: class Foo(BaseModel): field_first: str | None = Field( default=None, alias="first", description="The first field." ) field_seco...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/1073
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistent Field Naming Between `outputSchema` and `model_dump`","articleBody":"If the model to return by a tool is defined like:\n\n```python\nclass Foo(BaseModel):\n field_first: str | None = Field(\n default=None, alias=\"first\", description=\"The first field.\"\n )\n field_second: str | None = Field(\n default=None, alias=\"second\", description=\"The second field.\"\n )\n```\n\nIn `outputSchema` of `tools/list` they will be displayed as \"first\" and \"second\".\n\nAt the same time `model_dump` in\nhttps://github.com/modelcontextprotocol/python-sdk/blob/6f43d1f17022d9d45b51955304e39ad43ca48014/src/mcp/server/fastmcp/utilities/func_metadata.py#L114\nwill produce the dump with \"field_first\" and \"field_second\".\n\nTo keep the schema and the tool response consistent, consider adding `by_alias=True` to the call of `model_dump`.","author":{"url":"https://github.com/akolotov","@type":"Person","name":"akolotov"},"datePublished":"2025-07-03T03:58:32Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/1073"}
| 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:601ce030-2cad-b588-c840-14fd6338d31e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8986:358871:9AA2DE:CE2680:6B00E495 |
| html-safe-nonce | 1878d2202abcddf57cdfeddd8e44955152d4cb7c8e58645e486f39dd7397226a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OTg2OjM1ODg3MTo5QUEyREU6Q0UyNjgwOjZCMDBFNDk1IiwidmlzaXRvcl9pZCI6Ijg5NTMzNzUwMTg0NDA1MTY3NTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6411a651dcd5443fba6f6d460f2effcbc0078127647a3b2ba65b0405810b8feb |
| hovercard-subject-tag | issue:3197914011 |
| 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/1073/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f1e3a1cf5f8410f86a37bf615868a958a4dd4e3bd93d47607640d6352a65be99/modelcontextprotocol/python-sdk/issues/1073 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f1e3a1cf5f8410f86a37bf615868a958a4dd4e3bd93d47607640d6352a65be99/modelcontextprotocol/python-sdk/issues/1073 |
| og:image:alt | If the model to return by a tool is defined like: class Foo(BaseModel): field_first: str | None = Field( default=None, alias="first", description="The first field." ) field_second: str | None = Fie... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | akolotov |
| hostname | github.com |
| expected-hostname | github.com |
| None | 27088b6977484d0d3321d9a11c907c6d6637b315cfa359ef7952dbf6292f9b14 |
| 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 | 624179fb8b88d26ba5bba08894eb60a1c5a1d93d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width