fix(schema): MCP-compatible structured output and schema generation#10
Merged
dankelleher merged 5 commits intomainfrom Feb 12, 2026
Merged
fix(schema): MCP-compatible structured output and schema generation#10dankelleher merged 5 commits intomainfrom
dankelleher merged 5 commits intomainfrom
Conversation
user_google_email and service are auto-injected by the require_google_service decorator and not exposed as tool inputs. Documenting them in Args sections confuses MCP clients into thinking they are required input parameters.
…generation - Remove user_email field from all structured output dataclasses (contacts, calendar) since the caller already knows their own email - Centralize generate_schema() in core/structured_output.py using Pydantic TypeAdapter with anyOf stripping for MCP compatibility - Add _coerce_none() to strip None values from structured output before validation - Fix _coerce_none reference in create_tool_result (was still using old _strip_none name) - Fix tests to unpack (text, structured) tuples from _impl functions
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.
Summary
anyOfvalidation errorsuser_emailfrom all output models (redundant — caller already knows their email)generate_schema()incore/structured_output.pywithanyOfstrippinguser_google_email,service) from tool docstrings(text, structured)tuples from_implfunctions