curl --request POST \
--url https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts \
--header 'Authorization: Bearer gmcp_your_api_key' \
--header 'content-type: application/json' \
--data '
{
"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}}"
}
'
import requests
response = requests.post(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts",
headers={
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json"
},
json={
"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, keeping it under {{max_words}} words:\n\n{{article_text}}"
}
)
print(response.json())
const response = await fetch(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts",
{
method: "POST",
headers: {
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json"
},
body: JSON.stringify({
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, keeping it under {{max_words}} words:\n\n{{article_text}}"
})
}
);
const data = await response.json();
$response = wp_remote_post(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts",
[
"headers" => [
"Authorization" => "Bearer gmcp_your_api_key",
"Content-Type" => "application/json"
],
"body" => json_encode([
"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, keeping it under {{max_words}} words:\n\n{{article_text}}"
])
]
);
$data = json_decode(wp_remote_retrieve_body($response), true);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"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}}"
}`)
req, _ := http.NewRequest("POST", "https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts", body)
req.Header.Set("Authorization", "Bearer gmcp_your_api_key")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(string(data))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String json = "{\n \"name\": \"summarize_article\",\n \"description\": \"Summarize an article in a specified style and length\",\n \"arguments\": [\n {\"name\": \"article_text\", \"description\": \"The full article text\", \"required\": true},\n {\"name\": \"style\", \"description\": \"Summary style: bullet points or paragraph\", \"required\": false},\n {\"name\": \"max_words\", \"description\": \"Maximum word count for the summary\", \"required\": false}\n ],\n \"template_content\": \"Summarize the following article in {{style}} format, keeping it under {{max_words}} words:\\n\\n{{article_text}}\"\n}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts"))
.header("Authorization", "Bearer gmcp_your_api_key")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer gmcp_your_api_key'
request['Content-Type'] = 'application/json'
request.body = '{
"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}}"
}'
response = http.request(request)
puts JSON.parse(response.body)
{
"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...",
"server_uuid": "836995ae-1cff-41ec-823e-a4f07ccca3a0",
"created_at": "2025-03-18T10:00:00Z",
"updated_at": "2025-03-18T10:00:00Z"
}
Prompts
Create Prompt
Create a new prompt template within a server.
POST
/
wp-json
/
getmcp
/
v1
/
servers
/
{server_id}
/
prompts
curl --request POST \
--url https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts \
--header 'Authorization: Bearer gmcp_your_api_key' \
--header 'content-type: application/json' \
--data '
{
"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}}"
}
'
import requests
response = requests.post(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts",
headers={
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json"
},
json={
"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, keeping it under {{max_words}} words:\n\n{{article_text}}"
}
)
print(response.json())
const response = await fetch(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts",
{
method: "POST",
headers: {
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json"
},
body: JSON.stringify({
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, keeping it under {{max_words}} words:\n\n{{article_text}}"
})
}
);
const data = await response.json();
$response = wp_remote_post(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts",
[
"headers" => [
"Authorization" => "Bearer gmcp_your_api_key",
"Content-Type" => "application/json"
],
"body" => json_encode([
"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, keeping it under {{max_words}} words:\n\n{{article_text}}"
])
]
);
$data = json_decode(wp_remote_retrieve_body($response), true);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"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}}"
}`)
req, _ := http.NewRequest("POST", "https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts", body)
req.Header.Set("Authorization", "Bearer gmcp_your_api_key")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(string(data))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String json = "{\n \"name\": \"summarize_article\",\n \"description\": \"Summarize an article in a specified style and length\",\n \"arguments\": [\n {\"name\": \"article_text\", \"description\": \"The full article text\", \"required\": true},\n {\"name\": \"style\", \"description\": \"Summary style: bullet points or paragraph\", \"required\": false},\n {\"name\": \"max_words\", \"description\": \"Maximum word count for the summary\", \"required\": false}\n ],\n \"template_content\": \"Summarize the following article in {{style}} format, keeping it under {{max_words}} words:\\n\\n{{article_text}}\"\n}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts"))
.header("Authorization", "Bearer gmcp_your_api_key")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer gmcp_your_api_key'
request['Content-Type'] = 'application/json'
request.body = '{
"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}}"
}'
response = http.request(request)
puts JSON.parse(response.body)
{
"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...",
"server_uuid": "836995ae-1cff-41ec-823e-a4f07ccca3a0",
"created_at": "2025-03-18T10:00:00Z",
"updated_at": "2025-03-18T10:00:00Z"
}
Path Parameters
string
required
The numeric ID of the server to add the prompt to.
Body Parameters
string
required
Machine-readable prompt name (e.g.,
write_product_description). Use snake_case.string
Description of what this prompt does.
array
Array of argument objects. Each argument has:
name(string, required) — argument identifierdescription(string) — what the argument is forrequired(boolean) — whether it must be provided
string
required
The prompt text with
{{argument_name}} placeholders.curl --request POST \
--url https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts \
--header 'Authorization: Bearer gmcp_your_api_key' \
--header 'content-type: application/json' \
--data '
{
"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}}"
}
'
import requests
response = requests.post(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts",
headers={
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json"
},
json={
"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, keeping it under {{max_words}} words:\n\n{{article_text}}"
}
)
print(response.json())
const response = await fetch(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts",
{
method: "POST",
headers: {
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json"
},
body: JSON.stringify({
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, keeping it under {{max_words}} words:\n\n{{article_text}}"
})
}
);
const data = await response.json();
$response = wp_remote_post(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts",
[
"headers" => [
"Authorization" => "Bearer gmcp_your_api_key",
"Content-Type" => "application/json"
],
"body" => json_encode([
"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, keeping it under {{max_words}} words:\n\n{{article_text}}"
])
]
);
$data = json_decode(wp_remote_retrieve_body($response), true);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"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}}"
}`)
req, _ := http.NewRequest("POST", "https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts", body)
req.Header.Set("Authorization", "Bearer gmcp_your_api_key")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(string(data))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String json = "{\n \"name\": \"summarize_article\",\n \"description\": \"Summarize an article in a specified style and length\",\n \"arguments\": [\n {\"name\": \"article_text\", \"description\": \"The full article text\", \"required\": true},\n {\"name\": \"style\", \"description\": \"Summary style: bullet points or paragraph\", \"required\": false},\n {\"name\": \"max_words\", \"description\": \"Maximum word count for the summary\", \"required\": false}\n ],\n \"template_content\": \"Summarize the following article in {{style}} format, keeping it under {{max_words}} words:\\n\\n{{article_text}}\"\n}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts"))
.header("Authorization", "Bearer gmcp_your_api_key")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://yoursite.com/wp-json/getmcp/v1/servers/1/prompts')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer gmcp_your_api_key'
request['Content-Type'] = 'application/json'
request.body = '{
"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}}"
}'
response = http.request(request)
puts JSON.parse(response.body)
{
"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...",
"server_uuid": "836995ae-1cff-41ec-823e-a4f07ccca3a0",
"created_at": "2025-03-18T10:00:00Z",
"updated_at": "2025-03-18T10:00:00Z"
}
⌘I

