curl --request DELETE \
--url https://yoursite.com/wp-json/getmcp/v1/analytics/calls/filter \
--header 'Authorization: Bearer gmcp_your_api_key' \
--header 'content-type: application/json' \
--data '{
"server_id": "836995ae-1cff-41ec-823e-a4f07ccca3a0",
"status": "error",
"from": "2025-03-01",
"to": "2025-03-15"
}'
import requests
response = requests.delete(
"https://yoursite.com/wp-json/getmcp/v1/analytics/calls/filter",
headers={
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json",
},
json={
"server_id": "836995ae-1cff-41ec-823e-a4f07ccca3a0",
"status": "error",
"from": "2025-03-01",
"to": "2025-03-15",
},
)
print(response.json())
const response = await fetch(
"https://yoursite.com/wp-json/getmcp/v1/analytics/calls/filter",
{
method: "DELETE",
headers: {
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
server_id: "836995ae-1cff-41ec-823e-a4f07ccca3a0",
status: "error",
from: "2025-03-01",
to: "2025-03-15",
}),
}
);
const data = await response.json();
$response = wp_remote_request(
"https://yoursite.com/wp-json/getmcp/v1/analytics/calls/filter",
[
"method" => "DELETE",
"headers" => [
"Authorization" => "Bearer gmcp_your_api_key",
"Content-Type" => "application/json",
],
"body" => wp_json_encode([
"server_id" => "836995ae-1cff-41ec-823e-a4f07ccca3a0",
"status" => "error",
"from" => "2025-03-01",
"to" => "2025-03-15",
]),
]
);
$data = json_decode( wp_remote_retrieve_body( $response ), true );
{
"deleted": 487
}
{
"code": "rest_invalid_param",
"message": "At least one filter is required to delete by filter. Use the Settings page to clear all logs.",
"data": { "status": 400 }
}
{
"code": "rest_forbidden",
"message": "Permission denied.",
"data": { "status": 403 }
}
Analytics
Delete Call Logs by Filter
Delete every call log matching the supplied filter set.
DELETE
/
wp-json
/
getmcp
/
v1
/
analytics
/
calls
/
filter
curl --request DELETE \
--url https://yoursite.com/wp-json/getmcp/v1/analytics/calls/filter \
--header 'Authorization: Bearer gmcp_your_api_key' \
--header 'content-type: application/json' \
--data '{
"server_id": "836995ae-1cff-41ec-823e-a4f07ccca3a0",
"status": "error",
"from": "2025-03-01",
"to": "2025-03-15"
}'
import requests
response = requests.delete(
"https://yoursite.com/wp-json/getmcp/v1/analytics/calls/filter",
headers={
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json",
},
json={
"server_id": "836995ae-1cff-41ec-823e-a4f07ccca3a0",
"status": "error",
"from": "2025-03-01",
"to": "2025-03-15",
},
)
print(response.json())
const response = await fetch(
"https://yoursite.com/wp-json/getmcp/v1/analytics/calls/filter",
{
method: "DELETE",
headers: {
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
server_id: "836995ae-1cff-41ec-823e-a4f07ccca3a0",
status: "error",
from: "2025-03-01",
to: "2025-03-15",
}),
}
);
const data = await response.json();
$response = wp_remote_request(
"https://yoursite.com/wp-json/getmcp/v1/analytics/calls/filter",
[
"method" => "DELETE",
"headers" => [
"Authorization" => "Bearer gmcp_your_api_key",
"Content-Type" => "application/json",
],
"body" => wp_json_encode([
"server_id" => "836995ae-1cff-41ec-823e-a4f07ccca3a0",
"status" => "error",
"from" => "2025-03-01",
"to" => "2025-03-15",
]),
]
);
$data = json_decode( wp_remote_retrieve_body( $response ), true );
{
"deleted": 487
}
{
"code": "rest_invalid_param",
"message": "At least one filter is required to delete by filter. Use the Settings page to clear all logs.",
"data": { "status": 400 }
}
{
"code": "rest_forbidden",
"message": "Permission denied.",
"data": { "status": 403 }
}
Deletes call-log rows that match the same filter shape used by
GET /analytics/calls. The endpoint reuses the read-side filter builder, so anything you can list you can delete.
Typical use cases:
- Clear errors from a misbehaving tool while keeping success logs intact.
- Wipe a date window after running a load test against a production server.
- Drop the noisy
admin_testclient logs after a debugging session.
The endpoint requires at least one real filter. A
DELETE with no filters returns 400 so you can’t accidentally wipe the entire table — use the Settings page if that’s actually the intent.Permission is gated on the WordPress core capability
manage_options. Users with the lighter getmcp_view_analytics capability can read call logs but cannot delete them.Query/Body Parameters
Filters can be passed either as query string params or in a JSON body — pick whichever is convenient. The filter set matchesGET /analytics/calls.
string
Substring matched against
server.name, tool.name, method, client_type, client_ip, error_message.string
Filter by server UUID. Anything that doesn’t resolve to a known server is ignored.
string
Filter by
response_status. One of: success, error.string
Lower bound on
created_at (YYYY-MM-DD, WP timezone, inclusive of start-of-day).string
Upper bound on
created_at (YYYY-MM-DD, WP timezone, inclusive of end-of-day).string
Filter by JSON-RPC method family. One of:
tools, prompts, resources.integer
Only delete rows where
response_time_ms >= N. Useful for purging slow outliers.curl --request DELETE \
--url https://yoursite.com/wp-json/getmcp/v1/analytics/calls/filter \
--header 'Authorization: Bearer gmcp_your_api_key' \
--header 'content-type: application/json' \
--data '{
"server_id": "836995ae-1cff-41ec-823e-a4f07ccca3a0",
"status": "error",
"from": "2025-03-01",
"to": "2025-03-15"
}'
import requests
response = requests.delete(
"https://yoursite.com/wp-json/getmcp/v1/analytics/calls/filter",
headers={
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json",
},
json={
"server_id": "836995ae-1cff-41ec-823e-a4f07ccca3a0",
"status": "error",
"from": "2025-03-01",
"to": "2025-03-15",
},
)
print(response.json())
const response = await fetch(
"https://yoursite.com/wp-json/getmcp/v1/analytics/calls/filter",
{
method: "DELETE",
headers: {
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
server_id: "836995ae-1cff-41ec-823e-a4f07ccca3a0",
status: "error",
from: "2025-03-01",
to: "2025-03-15",
}),
}
);
const data = await response.json();
$response = wp_remote_request(
"https://yoursite.com/wp-json/getmcp/v1/analytics/calls/filter",
[
"method" => "DELETE",
"headers" => [
"Authorization" => "Bearer gmcp_your_api_key",
"Content-Type" => "application/json",
],
"body" => wp_json_encode([
"server_id" => "836995ae-1cff-41ec-823e-a4f07ccca3a0",
"status" => "error",
"from" => "2025-03-01",
"to" => "2025-03-15",
]),
]
);
$data = json_decode( wp_remote_retrieve_body( $response ), true );
{
"deleted": 487
}
{
"code": "rest_invalid_param",
"message": "At least one filter is required to delete by filter. Use the Settings page to clear all logs.",
"data": { "status": 400 }
}
{
"code": "rest_forbidden",
"message": "Permission denied.",
"data": { "status": 403 }
}
Response Fields
integer
Number of rows removed by the
DELETE query. 0 is a valid response when the filter matched nothing.
