Skip to main content
Glama

Frontman for WordPress

wp_update_widget

Destructive

Updates text, custom_html, block, or an existing woocommerce_recently_viewed_products widget without moving it. Recently viewed accepts title string and number integer (1–15); empty browsing history produces no output. Text accepts title/text strings and filter/visual booleans; custom_html accepts title/content strings; block requires complete replacement content. Omitted settings and metadata are preserved. Verify the rendered page in the same browsing session.

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>",
      "sidebar_id": "<sidebar_id>",
      "widget_id": "<widget_id>",
      "settings": "<settings>"
    },
    "name": "wp_update_widget"
  }
}

Input Schema

NameRequiredDescriptionDefault
site_idYesThe connected site's id returned by list_sites. Call list_sites first; do not use a URL or WordPress post ID.
settingsYesJSON-encoded object of widget settings to update (e.g. "{\"title\":\"My Widget\",\"text\":\"Hello\"}").
widget_idYesThe persisted widget instance ID (e.g. "text-2", "custom_html-4", "block-19"), not an editor preview ID.
sidebar_idYesThe sidebar/widget area ID (from wp_list_widget_areas).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses merge semantics ('omitted settings and metadata are preserved'), a per-type exception where block widgets require complete replacement content, and an edge case where empty browsing history produces no output. It also flags a post-call verification step tied to browsing session, which is real behavioural guidance the destructiveHint/openWorldHint annotations do not convey.

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?

Very dense with essentially zero filler, and the type-by-type rules are ordered logically. It reads as telegraphic run-on prose with semicolon-chained clauses, which is efficient but slightly harder to scan than a structured list would be.

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 an idempotent-false, destructive update with no output schema and full parameter coverage, it supplies the settings semantics, preservation behaviour, and a verification step. What remains unstated is failure behaviour (e.g. invalid widget_id, mismatched sidebar_id) and whether the call returns the updated widget state, though the absence of an output schema makes the latter less critical.

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?

The schema documents settings only as a JSON-encoded blob; the description decodes that blob by type — title/number (1–15) for recently viewed, title/text with filter/visual booleans for text, title/content for custom_html, full replacement for block. That is substantial meaning the schema alone cannot supply, far exceeding the 100%-coverage baseline of 3.

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 (updates) and resource (an existing widget) and enumerates exactly which widget types are in scope: text, custom_html, block, and woocommerce_recently_viewed_products. The qualifier 'without moving it' implicitly separates it from the move/create siblings, so an agent can tell what this tool is and is not without opening the schema.

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 word 'existing' plus the per-type settings rules give clear context for when this tool applies, and the closing instruction to verify the rendered page in the same browsing session tells the agent what to do after calling. It stops short of naming the alternative tools (wp_create_widget for new widgets, wp_move_widget for repositioning) or stating exclusions explicitly, so routing is inferable but not spelled out.

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.