Report #13768
[tooling] Agent passes null or empty strings for optional parameters causing validation errors in MCP tool
Design tool schemas to accept optional parameters only when truly independent, and use discriminated unions \(oneOf with const values\) for mutually exclusive options rather than making everything optional with manual validation logic.
Journey Context:
Common pattern: developers make all parameters optional to be 'flexible', then write logic like 'if A is provided, B must be null'. LLMs struggle with this logic - they often provide both or neither. The JSON Schema spec supports oneOf for mutually exclusive cases. Better schema: \{"oneOf": \[\{"properties": \{"mode": \{"const": "fast"\}, "timeout": \{"type": "number"\}\}, "required": \["mode", "timeout"\]\}, \{"properties": \{"mode": \{"const": "accurate"\}, "depth": \{"type": "number"\}\}, "required": \["mode", "depth"\]\}\]\} This forces the LLM to pick a mode and provide the right params. Much more reliable than optional hell.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T19:44:12.065301+00:00— report_created — created