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

# prompts/get

> Retrieve a rendered prompt template with argument values substituted.

The `prompts/get` method returns the fully rendered content of a prompt template. The server substitutes the provided argument values into the template and returns the result as a messages array ready to inject into a conversation.

## MCP Endpoint

```
POST https://yoursite.com/mcp/{slug}
Content-Type: application/json
```

## Request

<ParamField body="jsonrpc" type="string" required>
  Must be `"2.0"`.
</ParamField>

<ParamField body="id" type="integer | string" required>
  Arbitrary request identifier echoed back unchanged in the response.
</ParamField>

<ParamField body="method" type="string" required>
  Must be `"prompts/get"`.
</ParamField>

<ParamField body="params.name" type="string" required>
  The prompt template name to retrieve (e.g. `"write_product_description"`). Must match a name from `prompts/list`.
</ParamField>

<ParamField body="params.arguments" type="object">
  Key-value pairs for the prompt's defined arguments. Required arguments must be included or the call returns a validation error.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
       --url https://yoursite.com/mcp/my-server \
       --header 'content-type: application/json' \
       --header 'Mcp-Session-Id: your_session_id' \
       --data '
  {
    "jsonrpc": "2.0",
    "id": 2,
    "method": "prompts/get",
    "params": {
      "name": "write_product_description",
      "arguments": {
        "product_name": "Widget Pro",
        "key_features": "durable, lightweight, waterproof",
        "tone": "professional"
      }
    }
  }
  '
  ```

  ```python Python theme={null}
  import requests
  response = requests.post(
      "https://yoursite.com/mcp/my-server",
      headers={"Content-Type": "application/json"},
      json={
          "jsonrpc": "2.0",
          "id": 2,
          "method": "prompts/get",
          "params": {
              "name": "write_product_description",
              "arguments": {
                  "product_name": "Widget Pro",
                  "key_features": "durable, lightweight, waterproof",
                  "tone": "professional"
              }
          }
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://yoursite.com/mcp/my-server",
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        jsonrpc: "2.0",
        id: 2,
        method: "prompts/get",
        params: {
          name: "write_product_description",
          arguments: {
            product_name: "Widget Pro",
            key_features: "durable, lightweight, waterproof",
            tone: "professional"
          }
        }
      })
    }
  );
  const data = await response.json();
  ```
</RequestExample>

## Response

<ResponseField name="result.description" type="string">
  The prompt's description as configured.
</ResponseField>

<ResponseField name="result.messages" type="array">
  Array of message objects ready to inject into an AI conversation. Each message has:

  * `role` — Either `"user"` or `"assistant"`
  * `content.type` — Always `"text"` in the current implementation
  * `content.text` — The fully rendered prompt with all `{{argument_name}}` placeholders substituted
</ResponseField>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "jsonrpc": "2.0",
    "id": 2,
    "result": {
      "description": "Generate a compelling product description given product details",
      "messages": [
        {
          "role": "user",
          "content": {
            "type": "text",
            "text": "You are a product copywriter. Write a compelling product description for:\n\n**Product**: Widget Pro\n\n**Key Features**:\ndurable, lightweight, waterproof\n\n**Tone**: professional\n\nGuidelines:\n- Keep it under 150 words\n- Highlight the most important feature first\n- End with a clear call to action\n- Use professional language throughout"
          }
        }
      ]
    }
  }
  ```

  ```json 200 OK (prompt not found) theme={null}
  {
    "jsonrpc": "2.0",
    "id": 2,
    "error": {
      "code": -32602,
      "message": "Prompt not found: unknown_prompt"
    }
  }
  ```

  ```json 200 OK (missing required argument) theme={null}
  {
    "jsonrpc": "2.0",
    "id": 2,
    "error": {
      "code": -32602,
      "message": "Missing required argument: product_name"
    }
  }
  ```
</ResponseExample>

## Request Parameters

<ParamField body="params.name" type="string" required>
  The name of the prompt to retrieve. Must match a prompt name from `prompts/list`.
</ParamField>

<ParamField body="params.arguments" type="object">
  Key-value pairs to substitute into the prompt template. Required arguments (as defined in `prompts/list`) must be provided.
</ParamField>
