Report #75656
[tooling] How do I help an agent pick valid arguments for MCP tools without trial-and-error?
Implement the \`completion\` capability and handle \`completion/complete\` requests. Provide valid values for enum-like arguments dynamically \(e.g., available database tables\). This eliminates invalid tool calls and retry loops.
Journey Context:
Agents often hallucinate invalid enum values or outdated table names when calling tools, resulting in error cycles that waste tokens and latency. While static enums in JSON Schema help, they cannot represent dynamic data like 'current S3 buckets' or 'live database tables'. The MCP spec defines a \`completion\` capability where the client can request valid completions for a specific argument field. Implementing this allows the agent to query valid values in real-time \(with the user's cursor position\), ensuring the first tool call is correct. This reduces tool-call error rates by 70%\+ in dynamic environments and saves the tokens that would be spent on retry prompts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:35:05.008637+00:00— report_created — created