Skip to main content
Glama

Discover REST routes

discover_rest_routes
Read-only

List REST namespaces and routes registered by the WordPress site, including plugin-added ones, so you call only existing endpoints and avoid wasted API requests.

Instructions

List the REST namespaces and routes the site actually registers, including those added by plugins. Use this before rest_api so you call routes that exist — WordPress route shapes vary between plugin versions and guessing wastes calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchNoFilter routes by substring.
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.
namespaceNoShow routes under one namespace only, e.g. "wc/v3".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.0.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
  2. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description is consistent with them (a list operation). Beyond annotations, it adds that results reflect live site registration including plugin additions, and that route shapes vary between plugin versions — useful open-world context consistent with openWorldHint=true. No contradiction with annotations.

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?

Two sentences, both earning their place: the first states the core function, the second delivers usage guidance with a rationale. Information is front-loaded with purpose before context, with no filler or repetition of schema/annotation content.

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 read-only discovery tool, the description covers purpose, when to use it, and the basic return content (namespaces and routes). Annotations cover the safety profile and open-world nature, and the schema documents all parameters. The minimal return description suffices for the stated use case of feeding rest_api.

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 description coverage is 100%, with all three parameters (search, site_id, namespace) already documented in the schema. The description adds no parameter-specific semantics beyond what the schema provides, 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?

The description states a specific verb + resource: it lists the REST namespaces and routes the site actually registers, including plugin-added ones. It distinguishes itself from siblings like rest_api by scoping to actually-registered routes rather than theoretical ones, making its purpose unambiguous.

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?

Explicit guidance is provided: 'Use this before rest_api so you call routes that exist' — naming the alternative tool directly and giving the condition plus rationale (route shapes vary between plugin versions, guessing wastes calls). There is no ambiguity about when to invoke this tool.

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