Report #87769
[tooling] Agent calls wrong tool variant or fails on polymorphic arguments, requiring retries
Define a single tool with \`anyOf\` in the input schema to accept multiple argument shapes \(e.g., \`\{'file': string\} \| \{'content': string\}\`\) rather than splitting into \`toolA\` and \`toolB\`.
Journey Context:
Splitting polymorphic operations into separate tools \(\`readFile\` vs \`readContent\`\) forces the LLM to choose at the routing layer, often guessing wrong and burning tokens on 400 errors. JSON Schema's \`anyOf\` allows one tool to accept disjoint input shapes, validated server-side. The agent calls one tool with the variant it has; the server branches internally. This reduces tool sprawl and eliminates 'wrong tool' retries.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T05:54:26.335227+00:00— report_created — created