Skip to main content
New in version 2.0.0 Prompts are reusable message templates exposed by MCP servers. They can accept arguments to generate personalized message sequences for LLM interactions.

Listing Prompts

Use list_prompts() to retrieve all available prompt templates:

Filtering by Tags

New in version 2.11.0 You can use the meta field to filter prompts based on their tags:
The _meta field is part of the standard MCP specification. FastMCP servers include tags and other metadata within a _fastmcp namespace (e.g., _meta._fastmcp.tags) to avoid conflicts with user-defined metadata. This behavior can be controlled with the server’s include_fastmcp_meta setting - when disabled, the _fastmcp namespace won’t be included. Other MCP server implementations may not provide this metadata structure.

Using Prompts

Basic Usage

Request a rendered prompt using get_prompt() with the prompt name and arguments:

Prompts with Arguments

Pass arguments as a dictionary to customize the prompt:

Automatic Argument Serialization

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

Serialization Examples

Working with Prompt Results

The get_prompt() method returns a GetPromptResult object containing a list of messages:

Raw MCP Protocol Access

For access to the complete MCP protocol objects, use the *_mcp methods:

Multi-Server Clients

When using multi-server clients, prompts are accessible without prefixing (unlike tools):

Common Prompt Patterns

System Messages

Many prompts generate system messages for LLM configuration:

Conversation Templates

Prompts can generate multi-turn conversation templates:
Prompt arguments and their expected types depend on the specific prompt implementation. Check the server’s documentation or use list_prompts() to see available arguments for each prompt.