fastmcp.client.mixins.prompts
Prompt-related methods for FastMCP Client.
Classes
ClientPromptsMixin
Mixin providing prompt-related methods for Client.
Methods:
list_prompts_mcp
cursor: Optional pagination cursor from a previous request’s nextCursor.
- mcp.types.ListPromptsResult: The complete response object from the protocol, containing the list of prompts and any additional metadata.
RuntimeError: If called while the client is not connected.McpError: If the request results in a TimeoutError | JSONRPCError
list_prompts
- list[mcp.types.Prompt]: A list of all Prompt objects.
RuntimeError: If called while the client is not connected.McpError: If the request results in a TimeoutError | JSONRPCError
get_prompt_mcp
name: The name of the prompt to retrieve.arguments: Arguments to pass to the prompt. Defaults to None.meta: Request metadata (e.g., for SEP-1686 tasks). Defaults to None.
- mcp.types.GetPromptResult: The complete response object from the protocol, containing the prompt messages and any additional metadata.
RuntimeError: If called while the client is not connected.McpError: If the request results in a TimeoutError | JSONRPCError
get_prompt
get_prompt
get_prompt
name: The name of the prompt to retrieve.arguments: Arguments to pass to the prompt. Defaults to None.version: Specific prompt version to get. If None, gets highest version.meta: Optional request-level metadata.task: If True, execute as background task (SEP-1686). Defaults to False.task_id: Optional client-provided task ID (auto-generated if not provided).ttl: Time to keep results available in milliseconds (default 60s).
- mcp.types.GetPromptResult | PromptTask: The complete response object if task=False, or a PromptTask object if task=True.
RuntimeError: If called while the client is not connected.McpError: If the request results in a TimeoutError | JSONRPCError

