Report #45535
[tooling] Agent provides invalid enum values or free-text when constrained values should come from external API
Implement the \`completion\` capability handler on your MCP server to provide real-time, dynamic autocomplete suggestions for tool arguments based on live data \(e.g., valid user IDs from a database\), rather than static enums.
Journey Context:
Most examples use static JSON Schema enums for argument constraints. But when valid values come from a database \(e.g., 'project\_id'\), enums are impossible to keep updated. The MCP spec includes a \`completion\` method specifically for this: when the agent is filling arguments, the client can call \`completion/complete\` with the argument hint, and the server queries the live source. Most developers don't know this exists because the basic 'weather' tutorial doesn't cover dynamic schemas. This prevents the 'argument hallucination' where the agent guesses an ID. It requires implementing the \`completions\` capability in server features.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:54:14.429785+00:00— report_created — created