A host lets users pick a server prompt named code_review and fill in its language argument. As the user types "py", the host wants to show matching suggestions from the server in a dropdown. Which protocol approach supports this?
Select an answer to reveal the explanation.
Short Explanation
It's autocomplete in your code editor, but for prompt arguments. You send completion/complete pointing at the prompt, plus what's typed so far, and the server suggests up to 100 values. The trap is reaching for prompts/get, which fetches the finished prompt, not suggestions.
Full Explanation
The completion utility lets servers offer autocompletion for the arguments of prompts and resource templates. The client sends completion/complete with a ref that identifies what is being completed, either ref/prompt with the prompt's name or ref/resource with a URI or URI template, plus an argument object holding the argument name and the current partial value. Optional context.arguments carries values already chosen for other arguments. The server answers with completion.values, at most 100 per response, plus an optional total and a hasMore flag, and it must have declared the completions capability. Calling prompts/get repeatedly retrieves the rendered prompt messages, not suggestions, and would supply incomplete arguments. There is no ref/tool reference type; completion covers prompts and resource templates only, while tool arguments are produced by the model. A promptsListChanged subscription reports that the set of prompts changed and carries no argument suggestions at all. Exam caveat: the protocol does not mandate any user interface; a dropdown is just one host choice, and clients should debounce rapid requests. Operational check: confirm the server's server/discover capabilities include completions before the host enables live suggestions for that server.