Skip to main content
Glama

Read a menu

wp_get_menu
Read-onlyIdempotent

Retrieve a WordPress navigation menu and its ordered items by ID, slug, or name for read-only inspection. List available menus first if the target is unknown.

Instructions

Get one navigation menu with its items, in menu order. Returns menu (id, name) and items, each with item_id, title, url, parent (item_id of the parent item, 0 at top level) and order. Read-only; needs edit_theme_options. An unknown menu is a not-found error; wp_list_menus lists the menus.

Input Schema

NameRequiredDescriptionDefault
menuYesMenu id, slug or name, as wp_list_menus returns them.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, non-destructive behavior, and the description adds what they cannot: the required capability (edit_theme_options), the not-found error semantics for an unknown menu, and the exact shape of the returned payload including how parent=0 marks top level.

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?

Three sentences, front-loaded with the core action, followed by return shape and then the capability/error constraints. No filler and nothing repeated verbatim from the annotations.

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 no output schema, the description takes on the job of describing the return value, and it does so field by field. Combined with the auth requirement, error case, and pointer to the listing sibling, an agent has everything needed to invoke it correctly on the first try.

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 the schema already states the parameter accepts an id, slug or name as returned by wp_list_menus. The description echoes that usage without adding format, resolution-order, or edge-case detail, so the baseline of 3 applies.

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 ('Get one navigation menu with its items'), states the ordering scope ('in menu order'), and explicitly distinguishes itself from the sibling wp_list_menus, which lists rather than retrieves a single menu.

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?

It names the alternative for discovery ('wp_list_menus lists the menus') and notes the failure mode for an unknown menu, which effectively tells the agent how to find a valid identifier before calling. It stops short of an explicit 'use this when / don't use this when' statement, but the context is clear.

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