Skip to main content
Glama

Add a widget

create_widget

Add a widget to a sidebar, specifying the widget type and instance settings, including block content for modern widgets.

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.
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=false, so the description need not restate safety. It adds valuable context about how the block-based editor stores content in instance.content, which is beyond the schema's example. It does not contradict annotations and adds useful behavioral context for correct invocation.

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?

The description is two sentences with no filler. The purpose is stated first, followed by the most important usage detail (block widget markup). Every word earns its place; it is appropriately sized and front-loaded.

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?

With no output schema, the description does not explain return values, but for a create action that is often implicit. It covers the required semantics well: how to specify the widget type and the block widget nuance. It does not mention potential errors or permissions, but given the schema covers all parameters and annotations cover safety, the description is complete enough for correct usage.

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% and each parameter already has a descriptive definition, including instance examples for block and nav_menu. The description adds only a slight clarification about instance.content for block widgets, which is already covered by the schema's example. Baseline 3 is appropriate since the schema carries the semantic load.

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 leads with a specific verb and resource: 'Add a widget to a sidebar', which clearly identifies the action and target. It differentiates from siblings like update_widget and delete_widget by the action word 'Add'. It also provides concrete guidance on widget types, further clarifying scope.

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 description does not explicitly contrast with alternatives, but the purpose is unambiguous: it is the tool for creating a new widget. The mention of widget types and block-specific handling implies when to use it (when you need to add a widget with a given id_base). It lacks explicit 'use this instead of X' guidance, so it does not earn a 5.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alokemajumder/wpxmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server