Problem#
After #25018, the advertised MCP schemas still spell out every tagged union branch by branch: projectIcon repeats its 18-color enum, schedule, workspaceStrategy, sourcePoint, and the navigate target repeat shared fields per branch.
Change#
advertisedJsonSchema advertises a tagged union of objects (a shared property whose value is one literal per branch) as one object: the tag's enum lists every value, each other property appears once, and only fields every branch requires stay required. Decoding still uses the full union, so each tag's own required fields still apply and a wrong combination fails with the schema's message.
projectIcon: {"type":"object","properties":{"kind":{"type":"string","enum":["lucide","emoji","monogram"]},"name":{"type":"string"},"color":{"type":"string","enum":[...18 colors once...]},"emoji":{"type":"string"},"text":{"type":"string"}},"required":["kind"]}
Stacked on #25018.
Scope and approval#
Maintainer work (Theo), tool-definition hill climb after #24850.
Verification#
Full tool schemas, with the tool merges from #25124: 45,026 → 43,135 chars (about −1,900 chars, −470 tokens).
MCP eval (#24635) on the 24 cases whose expected calls use a tool with a merged union: Claude Opus 5.5 46 of 46 samples, GPT-6.1 Sol 96% of 47 (its one weak case, codex-same-model-subagents-stay-native, is a native-subagent decision and was weak on main). Full runs with this change: Opus 83 of 85 cases (95%), GPT-6 Astra 83 of 83 (99%).
vp test run src/mcp passes; advertisedJsonSchema.test.ts covers the merge.
Changes made with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code
Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — This PR changes the schemas advertised for existing MCP tools by merging tagged unions into new object shapes, using nontrivial new transformation logic. Although invocation validation remains separate and the change is tested, the externally consumed runtime contract changes across existing paths.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).