Skip to main content
Glama

wp_delete_custom_code

Destructive

Delete a site-wide code snippet by NAME (exact name from wp_list_custom_code). Removes it from every page immediately. To disable a snippet without losing it, call wp_set_custom_code with the same name and status='draft' instead.

Input Schema

NameRequiredDescriptionDefault
nameYesExact snippet name from wp_list_custom_code
site_idYesWordPress site id

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, so the safety profile is covered. The description adds real context beyond that: the effect is immediate and spans every page, and the disable-instead hint implies the deletion is lossy. It stops short of stating whether the deletion is recoverable or what the response returns.

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, tightly front-loaded: the action and identifier come first, the alternative path second. No filler and every clause adds either routing or behavioral information.

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

Completeness4/5

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

For a destructive, non-idempotent delete with no output schema, the description covers action, identifier source, blast radius, and the safer alternative. The only gap is return/confirmation behavior, which is minor given the annotations carry the safety signals.

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% with only two simple params, so the schema already documents them. The description reinforces the exact-match requirement for 'name' and its origin in wp_list_custom_code but adds no syntax or format detail beyond the schema. 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 a specific verb (Delete) and resource (site-wide code snippet), plus the required identifier (exact NAME from wp_list_custom_code). It also communicates scope ('site-wide', 'every page'), clearly distinguishing it from page-level delete siblings like wp_delete_page.

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?

Explicitly names the alternative when deletion is not the intent: call wp_set_custom_code with the same name and status='draft' to disable without losing the snippet. It also points to wp_list_custom_code as the source of the required name, leaving nothing to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources