Report #25272
[gotcha] Agent fails to select the correct MCP tool when input schemas contain hundreds of enum values
Avoid passing massive enum lists \(e.g., all 500 possible error codes\) in the tool's JSON schema. Instead, accept a generic string and validate server-side, or use a two-step process where the agent queries for valid options first.
Journey Context:
Developers often put all possible options into the tool's enum field to constrain the LLM. However, a massive enum array inflates the tool definition token count significantly, pushing the prompt over budget or diluting the LLM's attention. It is better to let the LLM use a natural language string and do server-side validation, returning an error if invalid.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:49:36.209622+00:00— report_created — created