Analytics
Delete Call Logs by Filter
Delete every call log matching the supplied filter set.
DELETE
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.
Substring matched against
server.name, tool.name, method, client_type, client_ip, error_message.Filter by server UUID. Anything that doesn’t resolve to a known server is ignored.
Filter by
response_status. One of: success, error.Lower bound on
created_at (YYYY-MM-DD, WP timezone, inclusive of start-of-day).Upper bound on
created_at (YYYY-MM-DD, WP timezone, inclusive of end-of-day).Filter by JSON-RPC method family. One of:
tools, prompts, resources.Only delete rows where
response_time_ms >= N. Useful for purging slow outliers.Response Fields
Number of rows removed by the
DELETE query. 0 is a valid response when the filter matched nothing.
