Skip to main content
Glama

Add a menu item

wp_add_menu_item
Destructive

Add a published item to a navigation menu, at the end: a link to a post, page or entry of another post type when object_id is given, otherwise a custom link to url. Returns added and item_id. Each call adds a new item, also when one with the same target exists. A URL with a scheme WordPress does not allow in menus (javascript:, data:) is refused. Needs edit_theme_options and the right to assign this menu (assign_term), which a site can withhold for single menus. No undo point is recorded; wp_delete_menu_item removes an item. Forwarded by AlphaBridge Connect to the one site this connection reaches.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "menu": "<menu>",
      "title": "<title>"
    },
    "name": "wp_add_menu_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoTarget of a custom link, e.g. https://example.com/, mailto:, tel: or a relative path. Ignored when object_id is given.
menuYesMenu id, slug or name, as wp_list_menus returns them.
titleYesLabel shown in the menu.
objectNoPost type of object_id, e.g. page or post. Default "page". Only used with object_id.
parentNoitem_id of the parent item, as wp_get_menu returns it, for a submenu entry. Default 0 (top level).
object_idNoPost/page id for a content link; its URL follows the post.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / menu / description
      Added value: +"Menu id, slug or name, as wp_list_menus returns them."
    • changedInput schema / properties / object / description
      Previous value: -"e.g. page, post, custom."New value: +"Post type of object_id, e.g. page or post. Default \"page\". Only used with object_id."
    • changedInput schema / properties / object_id / description
      Previous value: -"Post/page id for a content link."New value: +"Post/page id for a content link; its URL follows the post."
    • addedInput schema / properties / parent / description
      Added value: +"item_id of the parent item, as wp_get_menu returns it, for a submenu entry. Default 0 (top level)."
    • addedInput schema / properties / title / description
      Added value: +"Label shown in the menu."
    • addedInput schema / properties / url / description
      Added value: +"Target of a custom link, e.g. https://example.com/, mailto:, tel: or a relative path. Ignored when object_id is given."
  2. Added

TDQS

A4.7/5.0
Behavior5/5

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

Adds substantial context beyond the annotations: duplicate items are created even for identical targets (concretizing idempotentHint=false), disallowed URL schemes (javascript:, data:) are refused, and — critically, given wp_undo exists as a sibling — 'No undo point is recorded'. It also discloses per-menu permission withholding by the site.

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?

Front-loaded with the action and its two modes, then permissions, failure modes, and the undo caveat. Every clause carries information an agent needs; the trailing proxy note is relevant given openWorldHint=true.

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?

No output schema, but the description supplies the return shape ('added and item_id'), the error condition, the permission model, and the duplicate/undo behavior. Nothing an agent needs to invoke this mutation correctly is missing.

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 still adds value by restating the url/object_id precedence as a semantic rule and by disclosing the placement behavior ('at the end'), which no parameter exposes. It does not elaborate on parent or object beyond what the schema already says.

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?

Opens with a specific verb+resource ('Add a published item to a navigation menu') and immediately disambiguates the two modes of the tool: a content link when object_id is given, otherwise a custom link to url. This clearly separates it from wp_create_menu (creates the menu itself) and wp_get_menu (reads it).

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?

Explicitly states the object_id-vs-url selection rule and names wp_delete_menu_item as the removal path, plus the required capabilities (edit_theme_options, assign_term). It does not explicitly say to call wp_get_menu/wp_list_menus first to obtain menu ids and parent item_ids, though the schema hints at it.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources