Skip to main content
Glama

Frontman for WordPress

wp_update_custom_css

Destructive

Updates WordPress Additional CSS for the active theme. Default mode=replace accepts complete css and returns before/after CSS. For small changes, read wp_get_custom_css with source=persisted, then use mode=edit with oldText/newText and the returned scope and fingerprint. Matching is exact, not fuzzy. Insert by replacing an anchor with anchor plus new text; delete with empty newText. Edit returns compact observed metadata. Requires confirm=true after user approval. Conflict detection is best-effort, not atomic. Never retry automatically after a lost response.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "site_id": "<site_id>",
      "confirm": "<confirm>"
    },
    "name": "wp_update_custom_css"
  }
}

Input Schema

NameRequiredDescriptionDefault
cssNoRequired in replace mode: complete replacement Additional CSS contents.
modeNoDefaults to replace. Edit requires oldText, newText, stylesheet, parent_post_id, and expected_current_sha256; css is not allowed.
confirmYesMust be true after the user approves changing persistent site CSS.
newTextNoEdit only: literal replacement text, different from oldText. Empty string deletes.
oldTextNoEdit only: nonempty exact text to replace. Must match once unless replaceAll=true.
site_idYesThe connected site's id returned by list_sites. Call list_sites first; do not use a URL or WordPress post ID.
replaceAllNoEdit only: replace all non-overlapping exact occurrences. Defaults to false.
stylesheetNoTheme stylesheet slug. Required in edit mode, optional in replace mode. Must match the active stylesheet.
parent_post_idNoEdit only: current Custom CSS post ID from wp_get_custom_css.
expected_current_sha256NoEdit only: persisted_css_sha256 from the prior read. Best-effort conflict detection, not an atomic lock.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Goes well beyond the annotations (destructive, non-idempotent, open-world) by disclosing that replace returns before/after CSS, edit returns compact observed metadata, a confirm=true gate is required after user approval, conflict detection is best-effort rather than atomic, and automatic retries after a lost response are forbidden. The one notable gap is that the blast radius of replace mode is only implied, not stated outright.

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?

Front-loaded with purpose, then mode selection, then edit mechanics, then safety constraints, in a tight sequence of short sentences. Each sentence carries operational information - even the retry warning prevents data loss rather than padding the text.

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 10-parameter destructive mutation tool with no output schema, the description supplies the missing pieces: what replace and edit return, the confirm gate, the prerequisite read, and the conflict-detection limits. Nothing an agent needs in order to call this safely is absent.

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 real meaning the schema does not: the interplay between mode, css, and the edit-only fields, plus the exact-match constraint ("Matching is exact, not fuzzy") that governs oldText behavior. It stops short of restating each parameter's format, which the schema already handles.

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 ("Updates WordPress Additional CSS for the active theme") and immediately distinguishes its two operating modes. The agent can tell this apart from wp_get_custom_css and the revision siblings 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 routing: default replace mode for complete CSS, and for small changes it names the prerequisite read (wp_get_custom_css with source=persisted) and the exact mode/fields to use afterwards. It also spells out the insert (anchor plus new text) and delete (empty newText) patterns, leaving little 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.