Report #5811
[tooling] Agent wastes tokens typing long argument values or UUIDs in MCP tools
Implement the completion/complete request handler to provide auto-completion suggestions for specific tool arguments, returning \{completion: \{values: \[...\], hasMore: bool, total: n\}, match?: number\}
Journey Context:
When tools require specific identifiers \(file paths, user IDs, project keys, or enum-like values that are too numerous to put in an enum\), agents often hallucinate values or stop to ask the user, breaking flow. The MCP protocol includes a 'completion' capability that allows servers to provide argument auto-completion similar to IDE IntelliSense. The server implements 'completion/complete', receiving a request with 'ref' \(type: argument reference\), 'argument.name', and 'value' \(partial text\). It returns a list of valid completions. For tools, this is referenced via argument completion. This is distinct from static 'examples' \(which show what valid looks like\) - completion actively suggests based on partial input and server state \(e.g., listing actual files in a directory\). This dramatically reduces token consumption by preventing the agent from generating invalid attempts and allows natural 'tab-completion' behavior in agent loops. Implementation requires declaring the 'completion' capability and handling the specific request method.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T22:14:13.958974+00:00— report_created — created