Skip to content

fix(schema): MCP-compatible structured output schemas#11

Merged
dankelleher merged 1 commit intomainfrom
fix/strip-none-structured-output
Feb 12, 2026
Merged

fix(schema): MCP-compatible structured output schemas#11
dankelleher merged 1 commit intomainfrom
fix/strip-none-structured-output

Conversation

@dankelleher
Copy link
Member

@dankelleher dankelleher commented Feb 12, 2026

Summary

  • Strip None values from structured output to avoid MCP anyOf validation errors
  • Inline all $ref/$defs in output schemas (not supported by MCP validation)
  • Strip anyOf nullable patterns from output schemas (not supported by MCP validation)
  • Remove user_email from all output models (redundant — caller already knows their email)
  • Remove auto-injected params (user_google_email, service) from tool docstrings to avoid confusing MCP clients
  • Centralize generate_schema() in core/structured_output.py
  • Add generated tool schemas under schemas/
  • Fix tests to unpack (text, structured) tuples from _impl functions

MCP schema validation does not support JSON Schema $ref/$defs.
Pydantic generates these for nested dataclasses. Added _inline_refs()
to resolve all references inline before stripping anyOf patterns.
Regenerated all tool schemas.
@dankelleher dankelleher merged commit c2d079c into main Feb 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant