Skip to main content
Glama

Delete a theme

wp_delete_theme
Destructive

Permanently delete an installed theme's folder and files via a two-step preview and confirm token; active and parent themes are refused.

Instructions

Delete an installed theme's folder and files. The active theme and its parent theme are refused (wp_activate_theme switches to another theme); a newer version of a theme is installed by wp_update_theme, without deleting it. Returns deleted and stylesheet. Needs delete_themes; refused when DISALLOW_FILE_MODS is set. Permanent: no undo point is recorded. Runs in two steps: a call without confirm_token changes nothing and returns a preview with a confirm_token, and the same call with that token runs it. This guards against a call nobody meant; it does not make the change reversible.

Input Schema

NameRequiredDescriptionDefault
stylesheetYesExact directory name of an installed theme as wp_list_themes reports it, e.g. "twentytwentyfour". Anything else is refused.
confirm_tokenNoConfirmation from the preview: a call without it changes nothing and answers with a preview and a confirm_token, and the same arguments with that token run the tool. A token is valid for 10 minutes and only while what it covers is unchanged.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.10.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the destructiveHint=true annotation, the description discloses that the operation is permanent with no undo point, that a two-step preview/confirm token flow gates execution, and that the guard is anti-accident rather than a reversibility mechanism. It also names the return fields and the token's 10-minute validity constraint.

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?

Front-loaded with the action and the refusals, then the side effects, then the confirmation mechanism. Dense but every sentence carries information; the only waste is mild duplication of the two-step token flow already spelled out in the schema.

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?

For a destructive, irreversible mutation with no output schema, the description still covers permissions, environmental refusals, return values, reversibility, and the confirmation protocol. Nothing an agent needs in order to call this safely is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema: it frames confirm_token as an accidental-call guard that 'does not make the change reversible', which prevents an agent from misreading the token as an undo. Everything else (stylesheet format, token expiry) is already in the schema, so it does not reach 5.

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 a specific verb and resource with scope ('Delete an installed theme's folder and files'), and explicitly separates itself from wp_activate_theme and wp_update_theme by naming what those siblings do instead. An agent can distinguish this from every other theme tool without opening a schema.

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

Usage Guidelines5/5

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

Gives explicit when-not conditions ('active theme and its parent theme are refused') and routes to the correct alternative in each case: wp_activate_theme to switch, wp_update_theme to upgrade without deleting. Also names the precondition (delete_themes capability) and the DISALLOW_FILE_MODS refusal.

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