Skip to main content
Glama

Purge site caches

purge_cache
Idempotent

Clear all cached pages or a single URL across WordPress cache layers and host/CDN caches when front-end changes do not appear. Re-fetches the page afterward and reports cache headers to reveal whether a CDN still serves the old copy.

Instructions

Clear the site's caches through each installed cache layer's own API — WP Rocket, LiteSpeed, W3 Total Cache, WP Super Cache, WP Fastest Cache, SiteGround, Cache Enabler, Breeze, Hummingbird, Nginx Helper, Autoptimize, Varnish (Proxy Cache Purge), WP-Optimize, the Cloudflare plugin, and Kinsta / WP Engine / Pantheon / GoDaddy host caches — plus the object cache. Use it when a change does not appear on the front end. With scope "url" only that page is purged where the layer supports it. Afterwards the page is re-fetched as a visitor and its cache headers reported, so you can tell whether a CDN WordPress cannot reach still holds the old copy. Needs the companion plugin.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoPath or full URL on this site to purge, e.g. "/pricing/". Required when scope is "url"; for "all" it only chooses which page to re-fetch for verification (default: homepage).
scopeNo"all" purges every cache; "url" purges one page (layers without per-URL purging are cleared entirely).all
verifyNoRe-fetch the page anonymously after purging and report its cache headers.
site_idNoWhich configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark the action as non-readonly, non-destructive, and idempotent; the description enriches this by naming the exact mechanisms (each cache layer's own API), the per-URL fallback behavior, the post-purge re-fetch and cache-header report, and the companion-plugin requirement. This is substantial added transparency beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the main action and use case, and every sentence contributes useful detail. The exhaustive list of cache plugins and hosts is long but informative; it could be trimmed to 'all supported cache layers' without losing function, so 4.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With four parameters and no output schema, the description covers what the tool does, when to use it, prerequisite, scope behavior, verified re-fetch, and result reporting. Nothing needed to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the schema already explains url, scope, verify, and site_id in detail. The description restates the url/scope interaction but adds no new parameter-level semantics, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States the specific verb 'Clear' plus the resource 'the site's caches' and enumerates the concrete cache layers targeted. No sibling tool overlaps with this operation, so purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit trigger condition: 'Use it when a change does not appear on the front end.' It also explains url vs all scopes and flags the companion-plugin prerequisite, giving clear context. It does not name alternative tools or when-not-to-use cases, so it misses the top rung.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools