A server wants clients to show suggested values while users type arguments for its prompts and resource templates. What must the server do to offer this?
Select an answer to reveal the explanation.
Short Explanation
Autocomplete in MCP works like the dropdown in your IDE: the client asks, the server suggests. But the server has to raise its hand first by declaring the completions capability. The trap is thinking some other flag quietly switches it on.
Full Explanation
The completion utility lets servers offer autocompletion for the arguments of prompts and resource templates. Servers that support it must declare the completions capability. A client then sends completion/complete with a reference of type ref/prompt, by name, or ref/resource, by URI or URI template, plus the argument name and the partial value, and can add already-resolved arguments in context.arguments. The server returns ranked values, at most 100 per response, with an optional total and a hasMore flag. Setting listChanged on prompts fails because that flag only says the server will notify subscribers when the prompt list changes; it has nothing to do with argument values. Adding an enum list to prompt arguments fails by concept: prompt arguments are described by a name, an optional description and a required flag, with no schema keywords for clients to read. Sending suggestions in an InputRequiredResult fails because that mechanism asks the client for input such as elicitation during tools/call, resources/read or prompts/get; it is not a completion channel. Exam caveat: a server without the capability should answer completion/complete with -32601, method not found. Operational check: confirm completions appears in the DiscoverResult capabilities and that a partial value returns at most 100 ranked suggestions.