Skip to main content
Glama

Delete a theme file

delete_theme_file
Destructive

Delete a file from a WordPress theme draft. Safeguards live themes and blocks removal of required templates.

Instructions

Delete a file from a theme draft. Refuses to touch a live active theme unless explicitly allowed. Deleting a required template (index.php, style.css) breaks the theme.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath relative to the theme root.
themeNoTheme stylesheet or draft id.
confirmNoRequired — the file is removed from the server.
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.
allow_live_themeNoPermit acting on the live active theme. Use a draft instead.
Behavior5/5

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

The description goes well beyond the annotations (readOnlyHint=false, destructiveHint=true) by specifying the exact refusal behavior on live themes, the requirement for explicit allowance, and the consequence of deleting required templates. This enriches the agent's understanding of side effects without contradicting annotations.

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

Conciseness5/5

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

Two sentences with no redundant content. The primary purpose is stated first, followed by critical safety warnings. Every sentence contributes information that an agent needs to use the tool correctly—no fluff, and the structure is front-loaded.

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 tool with 5 parameters, the description covers the key behavioral caveats: live-theme refusal, the confirm requirement, and the danger of deleting core templates. It does not mention return values, but since no output schema is provided and the tool's purpose is clear, this is acceptable. The description is sufficient for an agent to invoke the tool safely and correctly.

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 description coverage is 100%, so baseline is 3. The description adds context for theconfirm and allow_live_theme parameters by explaining when they are needed (e.g., to override the live-theme refusal) and the risk of breaking required templates. This adds semantic value beyond the schema's parameter descriptions.

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?

The description states a specific action ('Delete a file from a theme draft'), identifies the resource (theme file), and implicitly distinguishes from sibling tools like write_theme_file and edit_theme_file by focusing on deletion. It also adds essential context about not touching live themes, making the scope clear.

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?

The description gives clear guidance on when to use this tool (on theme drafts) and warns against using it on live active themes unless explicitly allowed. It also notes the risk of deleting required templates. While it doesn't name alternative sibling tools explicitly, the guidance about draft vs. live is sufficient for an agent to decide. The mention of 'visit a draft instead' is implicit in 'Refuses to touch a live active theme unless explicitly allowed.'

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alokemajumder/wpxmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server