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 withget_prompt():
Argument Serialization
New in version2.9.0
FastMCP automatically serializes complex arguments to JSON strings as required by the MCP specification. You can pass typed objects directly:
pydantic_core.to_json() for consistent formatting. FastMCP servers automatically deserialize these JSON strings back to the expected types.
Working with Results
Theget_prompt() method returns a GetPromptResult containing a list of messages:
Version Selection
New in version3.0.0
When a server exposes multiple versions of a prompt, you can request a specific version:
Multi-Server Clients
When using multi-server clients, prompts are accessible directly without prefixing:Raw Protocol Access
For complete control, useget_prompt_mcp() which returns the full MCP protocol object:

