Gram by Speakeasy
Introducing Gram by Speakeasy. Gram is everything you
need to power integrations for Agents and LLMs. Easily create, curate and host
MCP servers for internal and external use. Build custom tools and remix
toolsets across 1p and 3p APIs. Try building a MCP server now!
Completables: Autocomplete for MCP arguments
Completables are an advanced MCP feature that provides autocomplete functionality for prompt and resource arguments. When you register a prompt or resource that requires user input, you can make the arguments completable, allowing the MCP client to provide suggestions by querying the server for available options.
This feature has not been widely adopted yet, but the TypeScript SDK supports it. Currently, it’s primarily implemented in the @modelcontextprotocol/inspector
client.
How completables work
When you register a completable argument, the MCP client can send partial input to the server and receive a list of matching suggestions. This is useful for arguments like:
- Chat or conversation names
- File paths
- User names
- Project identifiers
- Any other values that can be looked up or filtered
Implementing completables
Here’s how to register a completable for a prompt that requires a chat name:
The autocomplete flow
When a user types into an argument field:
- The MCP client sends a
completion/complete
request with the partial input - The MCP server calls the
complete
function with the partial string - The server returns matching suggestions
- The client displays the suggestions to the user
- The user selects a suggestion or continues typing
Use cases for completables
Completables are particularly valuable for:
- Large datasets: When there are too many options to display in a dropdown
- Fuzzy matching: When users might not know the exact spelling
- Dynamic data: When the available options change based on external state
- Performance: When loading all options upfront would be slow
Current limitations
While completables are part of the MCP specification and supported by the TypeScript SDK, client support is limited. Most MCP clients don’t yet implement the completion/complete
request handling required for this feature to work.
As the MCP ecosystem matures, we expect to see broader adoption of completables across different clients, making them a more practical option for improving the user experience of argument-heavy prompts and resources.
Last updated on