> ## Documentation Index
> Fetch the complete documentation index at: https://gofastmcp.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# prompts

# `fastmcp.client.mixins.prompts`

Prompt-related methods for FastMCP Client.

## Classes

### `ClientPromptsMixin` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/client/mixins/prompts.py#L23](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/client/mixins/prompts.py#L23)</sup>

Mixin providing prompt-related methods for Client.

**Methods:**

#### `list_prompts_mcp` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/client/mixins/prompts.py#L28](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/client/mixins/prompts.py#L28)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
list_prompts_mcp(self: Client) -> mcp_types.ListPromptsResult
```

Send a prompts/list request and return the complete MCP protocol result.

**Args:**

* `cursor`: Optional pagination cursor from a previous request's nextCursor.
* `cache_mode`: Response-cache behavior (only active with a cache and a modern
  connection). See `list_tools_mcp`.

**Returns:**

* mcp\_types.ListPromptsResult: The complete response object from the protocol,
  containing the list of prompts and any additional metadata.

**Raises:**

* `RuntimeError`: If called while the client is not connected.
* `MCPError`: If the request results in a TimeoutError | JSONRPCError

#### `list_prompts` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/client/mixins/prompts.py#L72](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/client/mixins/prompts.py#L72)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
list_prompts(self: Client, max_pages: int = AUTO_PAGINATION_MAX_PAGES) -> list[mcp_types.Prompt]
```

Retrieve all prompts available on the server.

This method automatically fetches all pages if the server paginates results,
returning the complete list. For manual pagination control (e.g., to handle
large result sets incrementally), use list\_prompts\_mcp() with the cursor parameter.

**Args:**

* `max_pages`: Maximum number of pages to fetch before raising. Defaults to 250.

**Returns:**

* list\[mcp\_types.Prompt]: A list of all Prompt objects.

**Raises:**

* `RuntimeError`: If the page limit is reached before pagination completes.
* `MCPError`: If the request results in a TimeoutError | JSONRPCError

#### `get_prompt_mcp` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/client/mixins/prompts.py#L120](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/client/mixins/prompts.py#L120)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
get_prompt_mcp(self: Client, name: str, arguments: dict[str, Any] | None = None, meta: dict[str, Any] | None = None) -> mcp_types.GetPromptResult
```

Send a prompts/get request and return the complete MCP protocol result.

**Args:**

* `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.

**Returns:**

* mcp\_types.GetPromptResult: The complete response object from the protocol,
  containing the prompt messages and any additional metadata.

**Raises:**

* `RuntimeError`: If called while the client is not connected.
* `MCPError`: If the request results in a TimeoutError | JSONRPCError

#### `get_prompt` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/client/mixins/prompts.py#L186](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/client/mixins/prompts.py#L186)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
get_prompt(self: Client, name: str, arguments: dict[str, Any] | None = None) -> mcp_types.GetPromptResult
```

Retrieve a rendered prompt message list from the server.

**Args:**

* `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.

**Returns:**

* mcp\_types.GetPromptResult: The complete response object.

**Raises:**

* `RuntimeError`: If called while the client is not connected.
* `MCPError`: If the request results in a TimeoutError | JSONRPCError


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.