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
Tool outputSchema is generated in validation mode, so serialization aliases and computed fields don't match structuredContent #3644
On v2 (2118f14), a tool returning a model with a serialization_alias or a @computed_field advertises an outputSchema that its own structuredContent violates:
Clients that validate structuredContent against outputSchema (as the spec says they should) reject these results. camelCase serialization aliases are common for JS-facing tools, so this hits anyone using them.
I had a fix for this in #3118 (closed in the v2 cleanup) and can port it to v2 with a regression test if you'd like to assign this to me.
@maxisbey since this is labeled for both v1 and v2: the fix I'd port is small. Generate the output schema with mode="serialization" in FuncMetadata.model_post_init, and when a tool returns its own CallToolResult, dump the validated structured_content with by_alias=True so it matches that schema. Regression test with a serialization alias and a computed field, on v2 first. Happy to take it if you assign it to me.
This is the same validation-versus-serialization outputSchema mismatch tracked in #3100, including serialization aliases and computed fields. Closing as a duplicate. AI-assisted triage; I reviewed both reports.
Activity
jayzuccarelli commentedon Oct 6, 2026
@maxisbey since this is labeled for both v1 and v2: the fix I'd port is small. Generate the output schema with
mode="serialization"inFuncMetadata.model_post_init, and when a tool returns its ownCallToolResult, dump the validatedstructured_contentwithby_alias=Trueso it matches that schema. Regression test with a serialization alias and a computed field, on v2 first. Happy to take it if you assign it to me.Kludex commentedon Oct 10, 2026
This is the same validation-versus-serialization
outputSchemamismatch tracked in #3100, including serialization aliases and computed fields. Closing as a duplicate. AI-assisted triage; I reviewed both reports.