Skip to main content
Glama

Add a widget

create_widget

Add a new widget to a sidebar, choosing from classic types or block markup, with settings for position and content.

Instructions

Add a widget to a sidebar. id_base names the widget type (block, text, nav_menu, search, categories, recent-posts…). For the modern "block" widget, put block markup in instance.content — that is how the block-based widget editor stores everything.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
id_baseYesWidget type: "block" for a block widget, or a classic type such as "text", "nav_menu", "search", "categories", "recent-posts".
sidebarYesTarget sidebar id, e.g. "sidebar-1". See list_sidebars.
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.
instanceNoWidget settings. For id_base "block", use {"content": "<!-- wp:paragraph --><p>Hi</p><!-- /wp:paragraph -->"}. For "nav_menu", {"title": "Menu", "nav_menu": 12}.
positionNoIndex within the sidebar. Appended if omitted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv2.0.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / instance / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / position / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / position / minimum
      Added value: +-9007199254740991
  2. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, and destructiveHint=false, so the mutation profile is known. The description adds genuinely useful behavioral context about how block widgets store markup in instance.content, which is beyond the schema. It does not disclose side effects, auth needs, or error behavior, but the annotation coverage lowers the bar and the added block-widget note earns some credit.

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 tight sentences with no filler. The core action is front-loaded, and the second sentence adds the one non-obvious detail (block widget storage) that an agent needs to invoke the tool correctly. Every word earns its place.

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?

Given five parameters, a nested instance object, and no output schema, the description covers the trickiest part — how block widgets store content — while the schema covers parameter formats and references list_sidebars and list_sites. It does not mention return values or failure modes, but annotations and schema carry enough of the safety and parameter burden to make the description reasonably complete for selecting and invoking the tool.

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%, so the schema already documents all five parameters thoroughly, including the block widget instance.content example. The description reinforces the id_base options and block-widget content requirement, but adds little meaning that is not already in the schema. This matches the baseline 3 for high schema coverage.

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 opens with a specific verb and resource: 'Add a widget to a sidebar.' It clearly distinguishes this create operation from sibling update_widget and delete_widget, and it adds useful type context via id_base examples. An agent can immediately tell what the tool does and that it creates, not modifies or removes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the verb 'Add' — use this when creating a new widget. However, the description does not explicitly state when to prefer this over update_widget or delete_widget, nor does it mention any prerequisites or exclusions. It relies on the reader inferring the create-vs-update distinction from the tool name and sibling list.

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

Deploy Server

Other Tools