Skip to main content
Glama

mcp_add_menu_item

Add a custom link, page, post, or taxonomy term to a WordPress menu by supplying the menu ID, title, and either a URL or object details.

Instructions

Add an item to a menu. A custom link needs url; a page/post or term item needs object_type post_type/taxonomy plus object and object_id of an existing object. Only the given fields are sent; the plugin defaults the rest (object_type custom, parent 0, appended at the end). target, classes, xfn, attr_title, description and status are set afterwards with mcp_update_menu_item.

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": {
      "site": "<site>",
      "menu_id": "<menu_id>",
      "title": "<title>"
    },
    "name": "mcp_add_menu_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoLink URL (custom links only)
siteYesSite id (see list_sites)
titleYesMenu item label
objectNoPost type or taxonomy slug of the linked object (page, post, category, product_cat, ...)
parentNoParent menu item ID (an item of the same menu; 0 = top level)
menu_idYesMenu ID
positionNoMenu order position
object_idNoID of the linked post or term
object_typeNoItem type: custom (link with url), post_type (page, post, CPT) or taxonomy (category, product_cat, ...). Plugin default: custom

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changedv3.14.0
    • changedInput schema / properties / menu_id / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / object / description
      Previous value: -"Object type (page, product_cat, etc.)"New value: +"Post type or taxonomy slug of the linked object (page, post, category, product_cat, ...)"
    • changedInput schema / properties / object_id / description
      Previous value: -"Object ID"New value: +"ID of the linked post or term"
    • changedInput schema / properties / object_id / type
      Previous value: -"number"New value: +"integer"
    • removedInput schema / properties / object_type / default
      Removed value: -"custom"
    • changedInput schema / properties / object_type / description
      Previous value: -"Item type"New value: +"Item type: custom (link with url), post_type (page, post, CPT) or taxonomy (category, product_cat, ...). Plugin default: custom"
    • removedInput schema / properties / parent / default
      Removed value: -0
    • changedInput schema / properties / parent / description
      Previous value: -"Parent menu item ID"New value: +"Parent menu item ID (an item of the same menu; 0 = top level)"
    • changedInput schema / properties / parent / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / position / description
      Previous value: -"Position in menu"New value: +"Menu order position"
    • changedInput schema / properties / position / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / title / description
      Previous value: -"Menu item title"New value: +"Menu item label"
    • changedInput schema / properties / url / description
      Previous value: -"URL for custom links"New value: +"Link URL (custom links only)"
  2. Changed2 schema fields changedv3.4.0
    • addedInput schema / properties / site
      Added value: +{
      +  "description": "Site id (see list_sites)",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "menu_id",
      -  "title"
      -]New value: +[
      +  "site",
      +  "menu_id",
      +  "title"
      +]
  3. First observedv2.0.0

TDQS

A4.6/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden, and it does substantial work by disclosing that only supplied fields are transmitted and that the plugin fills the rest with defaults (object_type custom, parent 0, appended at the end). It also reveals that a second call is needed for several item attributes, which shapes how an agent sequences calls. The gaps are failure behavior (e.g. what happens with an invalid object_id) and any permission or capability requirements.

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, all front-loaded with the operation first and the conditional requirements immediately after. Every clause carries information the agent needs (required pairings, defaults, follow-up call); there is no restatement of the name or filler.

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 9-parameter mutation with no annotations and no output schema, the definition covers the hard parts: which fields are required per item type, what the plugin defaults, and which fields require a subsequent update call. What it omits is the return value, which matters here because a caller likely needs the new item's ID to use as a parent later, and any permission expectations.

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 per-field meaning is already documented and the baseline is 3. The description earns more by documenting cross-field dependencies the schema does not express: url belongs to custom items, while object/object_id belong to post_type and taxonomy items, and object must match an existing object.

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 opening sentence states a specific verb and resource ("Add an item to a menu") and the rest of the definition makes the operation's branching shape concrete (custom link vs. post_type/taxonomy item). It also names the exact sibling, mcp_update_menu_item, that handles the fields this tool cannot set, so an agent can distinguish the two without opening another 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?

It gives explicit conditional selection rules: custom links require url, page/post or term items require object_type post_type/taxonomy plus object and object_id of an existing object. It also routes the agent to mcp_update_menu_item for target, classes, xfn, attr_title, description and status, which is a clear named alternative with the condition that selects it.

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