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. No undo point is recorded; wp_delete_menu_item removes an item. Forwarded by AlphaBridge Connect to the one site this connection reaches.

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.4/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses that no undo point is recorded (critical given wp_undo exists), that duplicates are created on repeat calls, that disallowed URL schemes (javascript:, data:) are refused, and that edit_theme_options is required. These are exactly the failure modes an agent could not infer from destructiveHint/idempotentHint alone.

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?

A single front-loaded paragraph that leads with the action and its two modes before consequences and caveats. It is dense and slightly run-on, and the closing AlphaBridge forwarding sentence is scoping context rather than tool behavior, but nothing is redundant.

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?

A six-parameter mutation tool with no output schema, and the description compensates by naming the return shape ("added and item_id") plus permissions, duplication behavior, and undo absence. An agent has everything needed to call it correctly and anticipate the outcome.

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 coverage is 100% and every one of the six parameters is already documented in the schema. The description reinforces the object_id/url precedence but adds no syntax, default, or format detail the schema does not already carry, so the baseline 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?

Specific verb plus resource ("Add a published item to a navigation menu") with the two operating modes spelled out: a content link when object_id is given, otherwise a custom link to url. An agent can distinguish it from wp_create_menu (creates the menu itself) and wp_delete_menu_item (removes items) without opening any schema.

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 names the removal counterpart (wp_delete_menu_item) and the capability prerequisite (edit_theme_options), and clarifies the object_id-vs-url selection rule. It does not explicitly state when to reach for wp_create_menu or wp_get_menu first, so it stops short of full when/when-not framing.

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