Skip to main content
Glama

List widgets

wp_get_widgets
Read-onlyIdempotent

List a WordPress site's widgets with their settings, for all widget areas or one sidebar; credential-like keys are hidden and named in hidden_keys. Read-only.

Instructions

List the site's widgets with their settings: by default those of all widget areas, inactive widgets included; with sidebar, only those of one area. Returns widgets: [{id, id_base, number, name, sidebar, settings}]; id is e.g. "text-2", sidebar the area id (empty when the widget is in none). A setting whose key looks like a credential (an API key, token, secret or password) is left out and named in hidden_keys. Needs edit_theme_options. Read-only; wp_list_sidebars lists the areas themselves.

Input Schema

NameRequiredDescriptionDefault
sidebarNoOptional widget area id from wp_list_sidebars, e.g. "sidebar-1" or "wp_inactive_widgets". When omitted, widgets of all areas are listed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well past the annotations: discloses the required capability (edit_theme_options), the exact return shape, that sidebar is empty for orphaned widgets, and — most importantly — that credential-like settings are redacted and reported in hidden_keys. That redaction behavior is non-obvious and would be surprising if undocumented.

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-loaded with purpose and default scope, then the return shape, then the caveat, then the permission requirement. Dense and largely waste-free, though the return-shape enumeration reads as a run-on that could be a single compact line.

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?

With one optional parameter, no output schema, and simple read-only annotations, the description covers everything an agent needs: default behavior, return fields, redaction semantics, and the required capability. Nothing material is left to guess.

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; the description adds value by stating the id format ("text-2"), that an empty sidebar means the widget belongs to no area, and what omission does. It stops short of saying whether an invalid area id errors or returns empty.

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?

Specific verb and resource ("List the site's widgets with their settings") plus the returned field list {id, id_base, number, name, sidebar, settings}. It also distinguishes itself from the neighboring areas tool by naming wp_list_sidebars, so an agent can separate the two without opening either 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?

States the selection behavior precisely: omitted sidebar lists all areas including inactive widgets, providing sidebar narrows to one area, and points to wp_list_sidebars when the agent actually wants areas rather than widgets. The when-to-use condition and the alternative are both explicit.

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