MCPcopy Index your code
hub / github.com/modelcontextprotocol/python-sdk / complete

Method complete

src/mcp/client/client.py:478–494  ·  view source on GitHub ↗

Get completions for a prompt or resource template argument. Args: ref: Reference to the prompt or resource template argument: The argument to complete context_arguments: Additional context arguments Returns: Completion suggestions.

(
        self,
        ref: ResourceTemplateReference | PromptReference,
        argument: dict[str, str],
        context_arguments: dict[str, str] | None = None,
    )

Source from the content-addressed store, hash-verified

476 return await self.session.get_prompt(name=name, arguments=arguments, meta=meta)
477
478 async def complete(
479 self,
480 ref: ResourceTemplateReference | PromptReference,
481 argument: dict[str, str],
482 context_arguments: dict[str, str] | None = None,
483 ) -> CompleteResult:
484 """Get completions for a prompt or resource template argument.
485
486 Args:
487 ref: Reference to the prompt or resource template
488 argument: The argument to complete
489 context_arguments: Additional context arguments
490
491 Returns:
492 Completion suggestions.
493 """
494 return await self.session.complete(ref=ref, argument=argument, context_arguments=context_arguments)
495
496 async def list_tools(self, *, cursor: str | None = None, meta: RequestParamsMeta | None = None) -> ListToolsResult:
497 """List available tools from the server."""

Calls

no outgoing calls