Stop pydantic 2.13 from leaking _WrappedResult docstring into tool output schemas#3918
Merged
Stop pydantic 2.13 from leaking _WrappedResult docstring into tool output schemas#3918
Conversation
…nto output schemas Pydantic 2.13 started emitting dataclass docstrings as schema `description`. The private wrapper was advertising "Generic wrapper for non-object return types." on every tool with a non-object return type. Also capitalizes MCP SDK in the upgrade-check issue template.
strawgate
pushed a commit
that referenced
this pull request
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pydantic 2.13 started emitting dataclass docstrings as JSON-schema
description. Our private_WrappedResultdataclass, which wraps non-object return types into the object shape MCP requires, had a docstring — so every tool returning e.g.int,str, orlist[...]began advertising "Generic wrapper for non-object return types." as the description of its output schema. That's a fastmcp implementation detail leaking into the user-visible tool manifest.Bumping the lockfile + snapping tests would only invert the problem (the
lowest-directCI job on pydantic 2.11.7 wouldn't emit the description and would go red). Dropping the docstring makes the schema version-insensitive across 2.11.7 → 2.13.0.Before (pydantic 2.13):
{"description": "Generic wrapper for non-object return types.", "properties": {"result": {"type": "integer"}}, "required": ["result"], "type": "object", "x-fastmcp-wrap-result": True}After:
{"properties": {"result": {"type": "integer"}}, "required": ["result"], "type": "object", "x-fastmcp-wrap-result": True}Also capitalizes "MCP SDK" in the upgrade-check issue template while we're here.
Closes #3902