Report #23990
[tooling] Agent provides invalid arguments for tool parameters that have dynamic enums or large valid value sets
Implement the \`completions\` capability and handle \`completion/complete\` requests to provide real-time autocomplete for argument values, validating against live database schemas, file systems, or API metadata
Journey Context:
Tool arguments are defined by JSON Schema, which supports \`enum\` for static lists. However, in real systems, valid values are dynamic: available database tables, existing S3 bucket names, or valid user IDs. Without completion support, the agent hallucinates values \(e.g., guessing a table name that doesn't exist\), leading to execution errors and expensive retry loops. The MCP spec defines a \`completions\` capability where the server can respond to \`completion/complete\` requests with valid values for a given argument, filtered by the partial input the user/agent has typed. This works like IDE autocomplete: the client sends the tool name, argument name, and current value prefix; the server queries the live system \(e.g., \`SHOW TABLES LIKE 'prefix%'\`\) and returns the matches. This prevents hallucination and reduces the token waste of 'argument error' -> 'retry' cycles. It is distinct from static \`enum\` arrays and requires explicit server implementation of the completion handler.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T18:40:32.215446+00:00— report_created — created