Skip to main content
POST
/
wp-json
/
getmcp
/
v1
/
servers
/
{server_id}
/
tools
curl -X POST \
  -H "Authorization: Bearer gmcp_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "create_customer",
    "description": "Create a new customer in Stripe",
    "endpoint_url": "https://api.stripe.com/v1/customers",
    "http_method": "POST",
    "input_schema": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "format": "email",
          "description": "Customer email address"
        },
        "name": {
          "type": "string",
          "description": "Customer full name"
        }
      },
      "required": ["email"]
    },
    "auth_type": "bearer",
    "auth_credentials": {
      "token": "sk_live_your_stripe_key"
    },
    "parameter_mapping": {
      "email": {"location": "body"},
      "name": {"location": "body"}
    },
    "timeout": 30,
    "status": "active"
  }' \
  "https://yoursite.com/wp-json/getmcp/v1/servers/2/tools"
{
  "id": 5,
  "server_id": 2,
  "name": "create_customer",
  "description": "Create a new customer in Stripe",
  "endpoint_url": "https://api.stripe.com/v1/customers",
  "http_method": "POST",
  "input_schema": {
    "type": "object",
    "properties": {
      "email": {"type": "string", "format": "email"},
      "name": {"type": "string"}
    },
    "required": ["email"]
  },
  "auth_type": "bearer",
  "auth_credentials": null,
  "parameter_mapping": {
    "email": {"location": "body"},
    "name": {"location": "body"}
  },
  "cache_ttl": 0,
  "timeout": 30,
  "sort_order": 0,
  "status": "active",
  "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 tool to.

Body Parameters

name
string
required
Machine-readable tool name used by AI clients (e.g., get_weather). Use snake_case.
description
string
Human-readable description. AI clients use this to decide when to call the tool.
endpoint_url
string
The HTTP URL to call when the tool is invoked. Supports {param} path placeholders.
http_method
string
default:"GET"
HTTP method. One of: GET, POST, PUT, PATCH, DELETE.
input_schema
object
JSON Schema object defining accepted input parameters.
auth_type
string
default:"none"
Outbound auth type for calling the external API. One of: none, api-key, bearer, basic, oauth2.
auth_credentials
object
Authentication credentials for the external API (encrypted at rest).
parameter_mapping
object
Maps input parameters to request locations (path, query, body, header).
headers
object
Custom HTTP headers to include in every request to the external API.
cache_ttl
integer
default:"0"
Cache response for N seconds. Set to 0 to disable.
timeout
integer
default:"30"
Request timeout in seconds.
status
string
default:"active"
Tool status. One of: active, paused.
curl -X POST \
  -H "Authorization: Bearer gmcp_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "create_customer",
    "description": "Create a new customer in Stripe",
    "endpoint_url": "https://api.stripe.com/v1/customers",
    "http_method": "POST",
    "input_schema": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "format": "email",
          "description": "Customer email address"
        },
        "name": {
          "type": "string",
          "description": "Customer full name"
        }
      },
      "required": ["email"]
    },
    "auth_type": "bearer",
    "auth_credentials": {
      "token": "sk_live_your_stripe_key"
    },
    "parameter_mapping": {
      "email": {"location": "body"},
      "name": {"location": "body"}
    },
    "timeout": 30,
    "status": "active"
  }' \
  "https://yoursite.com/wp-json/getmcp/v1/servers/2/tools"
{
  "id": 5,
  "server_id": 2,
  "name": "create_customer",
  "description": "Create a new customer in Stripe",
  "endpoint_url": "https://api.stripe.com/v1/customers",
  "http_method": "POST",
  "input_schema": {
    "type": "object",
    "properties": {
      "email": {"type": "string", "format": "email"},
      "name": {"type": "string"}
    },
    "required": ["email"]
  },
  "auth_type": "bearer",
  "auth_credentials": null,
  "parameter_mapping": {
    "email": {"location": "body"},
    "name": {"location": "body"}
  },
  "cache_ttl": 0,
  "timeout": 30,
  "sort_order": 0,
  "status": "active",
  "created_at": "2025-03-18T10:00:00",
  "updated_at": "2025-03-18T10:00:00"
}