Skip to main content
Glama

WordPress code reference

wp_code
Read-onlyIdempotent

Finds the official reference page for exact WordPress names: functions, hooks, classes, methods, WP-CLI commands, REST routes, core blocks and @wordpress packages. Use before writing or reviewing code that calls one, to confirm it exists in WordPress core, since which version, and whether it is deprecated. Pass up to 8 names in one call. Returns links with a one-line summary, never the page content; a name that is not in WordPress core is reported as not found. For a guide or a plugin's documentation, use wp_docs.

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": {
      "names": "<names>"
    },
    "name": "wp_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
namesYesExact names, separated by commas: "get_theme_mod, save_post, WP_Query::get_posts, wp plugin list, /wp/v2/posts, core/paragraph"

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent, non-destructive, and open-world, so the safety profile is covered; the description goes further by disclosing the return shape (links with a one-line summary, never the page content), the batch limit, and the not-found failure mode for names outside core. Those are exactly the traits that prevent an agent from expecting page text or from silently assuming a missing name exists.

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?

Four sentences, each doing distinct work: scope, when-to-use, capacity, return/failure behavior, then the sibling routing. The most decision-relevant information leads, and nothing is repeated from the schema or 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?

There is no output schema, so the description must characterize results, and it does: link plus one-line summary, no page content, not-found reported per name. Combined with the single well-documented parameter and existing annotations, an agent has everything needed to call this correctly and interpret the response.

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?

With only one parameter and 100% schema coverage, the schema already carries the comma-separated syntax and examples. The description still adds real meaning beyond it: the batch cap of 8 names per call and the 'exact names' requirement, which implies no fuzzy or partial matching. That is more than the baseline 3 warrants, though it stops short of describing error behavior per name in detail.

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?

States a specific verb (finds) and resource (official reference page for exact WordPress names), then enumerates the name categories covered: functions, hooks, classes, methods, WP-CLI commands, REST routes, blocks, and @wordpress packages. That enumeration plus the explicit hand-off to wp_docs makes it separable from every sibling without opening a 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?

Gives an explicit when: 'Use before writing or reviewing code that calls one,' with the purpose spelled out (confirm it exists in core, since which version, whether deprecated). Also gives an explicit when-not plus the alternative: 'For a guide or a plugin's documentation, use wp_docs.' No inference required.

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