Skip to main content
POST
/
wp-json
/
getmcp
/
v1
/
servers
/
{server_id}
/
prompts
curl -X POST \
  -H "Authorization: Bearer gmcp_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "summarize_article",
    "description": "Summarize an article in a specified style and length",
    "arguments": [
      {"name": "article_text", "description": "The full article text", "required": true},
      {"name": "style", "description": "Summary style: bullet points or paragraph", "required": false},
      {"name": "max_words", "description": "Maximum word count for the summary", "required": false}
    ],
    "template_content": "Summarize the following article in {{style}} format, keeping it under {{max_words}} words:\n\n{{article_text}}"
  }' \
  "https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts"
{
  "id": 2,
  "server_id": 1,
  "name": "summarize_article",
  "description": "Summarize an article in a specified style and length",
  "arguments": [
    {"name": "article_text", "description": "The full article text", "required": true},
    {"name": "style", "description": "Summary style", "required": false},
    {"name": "max_words", "description": "Maximum word count", "required": false}
  ],
  "template_content": "Summarize the following article in {{style}} format...",
  "created_at": "2025-03-18T10:00:00",
  "updated_at": "2025-03-18T10:00:00"
}

Path Parameters

server_id
integer
required
The numeric ID of the server to add the prompt to.

Body Parameters

name
string
required
Machine-readable prompt name (e.g., write_product_description). Use snake_case.
description
string
Description of what this prompt does.
arguments
array
Array of argument objects. Each argument has:
  • name (string, required) — argument identifier
  • description (string) — what the argument is for
  • required (boolean) — whether it must be provided
template_content
string
required
The prompt text with {{argument_name}} placeholders.
curl -X POST \
  -H "Authorization: Bearer gmcp_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "summarize_article",
    "description": "Summarize an article in a specified style and length",
    "arguments": [
      {"name": "article_text", "description": "The full article text", "required": true},
      {"name": "style", "description": "Summary style: bullet points or paragraph", "required": false},
      {"name": "max_words", "description": "Maximum word count for the summary", "required": false}
    ],
    "template_content": "Summarize the following article in {{style}} format, keeping it under {{max_words}} words:\n\n{{article_text}}"
  }' \
  "https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts"
{
  "id": 2,
  "server_id": 1,
  "name": "summarize_article",
  "description": "Summarize an article in a specified style and length",
  "arguments": [
    {"name": "article_text", "description": "The full article text", "required": true},
    {"name": "style", "description": "Summary style", "required": false},
    {"name": "max_words", "description": "Maximum word count", "required": false}
  ],
  "template_content": "Summarize the following article in {{style}} format...",
  "created_at": "2025-03-18T10:00:00",
  "updated_at": "2025-03-18T10:00:00"
}