Skip to main content
Glama

WordPress: remove a header or footer snippet

wp_snippet_remove
Destructive

Remove one existing snippet (e.g. an old promo-bar script) from a header/footer plugin or the theme's own script box: pass one block exactly as wp_snippets_get lists it (it must appear exactly once), or, for a block mixed in with others, starts_with and ends_with (everything from the one starts_with through the first ends_with after it; Bridge 1.7.1+). Adding snippets is never possible. The preview shows exactly what would be removed; confirm to remove. The whole old value is backed up and the site cache cleared. Needs Bridge 1.7.0+ and an administrator's application password.

Input Schema

NameRequiredDescriptionDefault
siteYes
exactNoOne block exactly as listed
optionYesFrom wp_snippets_get, e.g. shfs_insert_footer or _crb_footer_script
confirmNoLeave false to preview: nothing changes and the preview shows exactly what would happen. Set true only after the user has agreed to this exact change.
ends_withNoWith starts_with: the text the span ends with, e.g. </script>
starts_withNoInstead of exact: the text the span starts with (appearing once), e.g. the comment naming it

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / ends_with
      Added value: +{
      +  "description": "With starts_with: the text the span ends with, e.g. </script>",
      +  "maxLength": 400,
      +  "type": "string"
      +}
    • changedInput schema / properties / exact / description
      Previous value: -"The block exactly as listed"New value: +"One block exactly as listed"
    • removedInput schema / properties / exact / minLength
      Removed value: -1
    • changedInput schema / properties / option / description
      Previous value: -"From wp_snippets_get, e.g. shfs_insert_footer"New value: +"From wp_snippets_get, e.g. shfs_insert_footer or _crb_footer_script"
    • addedInput schema / properties / starts_with
      Added value: +{
      +  "description": "Instead of exact: the text the span starts with (appearing once), e.g. the comment naming it",
      +  "maxLength": 400,
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "site",
      -  "option",
      -  "exact"
      -]New value: +[
      +  "site",
      +  "option"
      +]
  2. Added

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the destructiveHint/readOnlyHint annotations: it discloses that the whole old value is backed up, that the site cache is cleared, that the preview is non-mutating by default, that the match must be unique, and that Bridge 1.7.0+ is required. These are real operational consequences an agent needs before calling a destructive tool.

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-loads the core action and mode selection, then prerequisites and side effects, with no filler sentences. It is a dense single paragraph of clauses rather than cleanly separated statements, which slightly hurts scannability but every clause carries information.

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, version-dependent tool with no output schema, it covers prerequisites (Bridge 1.7.0+, admin app password), the safe-preview convention, matching ambiguity, backup and cache-clear side effects, and what the preview returns. Nothing material needed to call it safely is missing.

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

Parameters5/5

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

Schema coverage is already 83%, but the description adds genuine semantics the schema lacks: "exact" must appear exactly once, and starts_with/ends_with select "everything from the one starts_with through the first ends_with after it" with the starts_with appearing once. That disambiguates matching behavior that the terse schema fields do not.

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+resource ("Remove one existing snippet") plus the scope (header/footer plugin or theme script box) and explicitly rules out the inverse operation ("Adding snippets is never possible"). It also names the sibling wp_snippets_get as the source of valid blocks, so it is distinguishable from the surrounding wp_* tools.

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 clear selection rules between the two modes: one block exactly as wp_snippets_get lists it (appearing exactly once), or starts_with/ends_with for blocks mixed with others. It also describes the preview→confirm workflow and the prerequisite of an administrator's application password. No explicit statement of when NOT to use it beyond the addition exclusion, so not a 5.

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.