Report #38277
[gotcha] LLM passes free-form text to a tool parameter that expects a strict enum causing silent execution failure
Define strict \`enum\` arrays in the MCP tool's JSON schema for any parameter with a fixed set of valid values, rather than relying on \`type: string\` and a natural language description.
Journey Context:
Developers often define tool parameters as \`type: string\` with a description like 'Must be open or closed'. LLMs frequently ignore this and pass 'currently open' or 'unlocked'. The MCP server receives the string, fails to match it in a switch statement, and throws a cryptic error or does nothing. JSON Schema \`enum\` forces the LLM's constrained decoding to only output valid values.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:43:13.962985+00:00— report_created — created