You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Declared schema defaults stay unhydrated with additionalProperties: true #5737
bugSomething isn't working. Reports of errors, unexpected behavior, or broken functionality.serverRelated to FastMCP server implementation or server-side functionality.
With additionalProperties: true, a declared property's valid JSON default is returned without the hydration applied to the same explicitly supplied value. A default date is a str, while the equivalent explicit date becomes datetime.date. A nested-object default similarly remains a dict. Setting additionalProperties: false makes both paths hydrate consistently.
I also reproduced the date case through an in-memory Client(server): a tool returning ToolResult(structured_content={}) yields a string in result.data.day. I expected the same Python type whether the valid value came from the schema default or from the result. The wire content should stay unchanged.
Reproduced on unchanged main at e2fcc412001ff7414095c5dc282f94c70299a612: FastMCP 4.1.1.dev2+e2fcc412, MCP 2.0.0, Pydantic 2.13.4, Python 3.13.14, Windows 11. No network or model credentials needed.
I searched related issues and PRs. #5656 addresses typed additional fields; this report concerns defaults of declared fields with additionalProperties: true.
AI assistance: Codex helped investigate and run the local reproductions. I would like to contribute a focused fix and regression tests for this inconsistency.
bugSomething isn't working. Reports of errors, unexpected behavior, or broken functionality.serverRelated to FastMCP server implementation or server-side functionality.
Activity
Fix PrefectHQ#5737: Declared schema defaults stay unhydrated with add…