Skip to main content
New in version 2.0.0 Use this when you need to retrieve server-defined message templates for LLM interactions. Prompts are reusable message templates exposed by MCP servers. They can accept arguments to generate personalized message sequences for LLM interactions.

Basic Usage

Request a rendered prompt with get_prompt():
Pass arguments to customize the prompt:

Argument Serialization

New in version 2.9.0 FastMCP automatically serializes complex arguments to JSON strings as required by the MCP specification. You can pass typed objects directly:
The client handles serialization using pydantic_core.to_json() for consistent formatting. FastMCP servers automatically deserialize these JSON strings back to the expected types.

Working with Results

The get_prompt() method returns a GetPromptResult containing a list of messages:
Prompts can generate different message types. System messages configure LLM behavior:
Conversation templates generate multi-turn flows:

Version Selection

New in version 3.0.0 When a server exposes multiple versions of a prompt, you can request a specific version:
See Metadata for how to discover available versions.

Multi-Server Clients

When using multi-server clients, prompts are accessible directly without prefixing:

Raw Protocol Access

For complete control, use get_prompt_mcp() which returns the full MCP protocol object: