Skip to main content
Glama

Add a menu item

add_menu_item

Add entries to WordPress navigation menus, linking to posts, pages, terms, or custom URLs, with support for submenus and ordering.

Instructions

Add an entry to a navigation menu. It can point at a post, page or custom post type (object_id + object), a taxonomy term, or an arbitrary URL. Use parent to nest it under another item and menu_order to position it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoTarget URL. Required for type "custom".
xfnNoXFN relationship value for the link.
typeNocustom: an arbitrary URL. post_type: link to a post/page/CPT (set object + object_id). taxonomy: link to a term. post_type_archive: link to a CPT archive.custom
titleYesLink label.
objectNoFor post_type: the post type slug ("page"). For taxonomy: the taxonomy slug ("category").
parentNoMenu item ID to nest under, creating a submenu.
targetNo_blank opens in a new tab.
classesNoExtra CSS classes on the link.
menu_idYesMenu to add to.
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.
object_idNoID of the post or term being linked to.
attr_titleNoThe link's title attribute.
menu_orderNoPosition within the menu. Lower numbers come first.
descriptionNoItem description, shown by themes that support it.
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, and idempotentHint=false, so the agent knows this is a non-destructive, non-idempotent write. The description adds context about the item types and the use of parent/menu_order, which exceeds what annotations alone convey. However, it does not mention any side effects, permissions, or error conditions, and the schema covers most parameter behavior. The added context is moderate, not exceptional.

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, front-loaded with the primary action and main variants. It avoids unnecessary details and every sentence earns its place, clearly explaining the tool's scope and its two key modifier parameters without bloat.

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 a tool with 14 parameters but only 2 required and comprehensive schema descriptions, the description provides enough high-level context to understand the tool's purpose and the main usage patterns. The absence of an output schema means return values need not be explained. It could mention that each call creates a new item (non-idempotent), but the idempotentHint=false annotation already conveys this. Overall, it is fairly complete for its complexity.

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?

The schema covers all 14 parameters with detailed descriptions (100% coverage). The description adds a little connectivity between type, object, object_id, and the concept of nesting/positioning, but it largely restates information already in the schema. Given the high schema coverage, the description does not need to repeat parameter details, and this is a baseline 3 where the schema does the heavy lifting.

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 an entry to a navigation menu." It clearly distinguishes from sibling tools like update_menu_item and delete_menu_item by stating the core action and the variety of targets (post, page, CPT, taxonomy, arbitrary URL). The purpose is unambiguous.

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 clearly implies usage for creating a new menu item, and it gives guidance on nesting and ordering via parent and menu_order. It does not explicitly mention when not to use it or compare it to update_menu_item, but the context of 'add' versus the existence of an update sibling is clear enough for an agent to infer the right choice.

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