Skip to main content
Glama
Doublehead

codegraph

by Doublehead

hooks

Resolve WordPress hook or filter names to registered listeners and entry points, revealing public attack surface through wp_ajax and REST routes.

Instructions

WordPress hook/filter dispatch - the string-named action/filter coupling a call graph CANNOT see (add_action/add_filter/register_rest_route/do_action/apply_filters).

  • name = a hook/action/filter name or REST route -> its in-repo listeners + fire sites.

  • name = a symbol -> the hooks it's registered on (the high-confidence callback->hook direction: "register_routes fires on rest_api_init").

  • entry_points=True or empty name -> the public attack surface: every wp_ajax_* / wp_ajax_nopriv_* / register_rest_route callback, with UNAUTH flagged.

Blind spots (honest): dynamic/interpolated hook names, closures, and variable callbacks (call_user_func($x)) cannot be resolved and are not edges.

This tool - NOT the edges_hook count - is the source of truth for whether WordPress coupling was captured. edges_hook: 0 is normal for a pure-listener plugin (its callbacks are fired by WP core / the REST framework, not by its own do_action), and REST routes never contribute to that count by design. If a hook seems missing, check here first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo
rootNo.
entry_pointsNo
Behavior5/5

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

With no annotations, the description fully discloses behavioral traits: it explains what it resolves (hooks, REST routes, symbols), what it cannot resolve (dynamic names, closures, variable callbacks), and how it handles entry_points. It also states it is the source of truth for WordPress coupling capture.

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?

The description is well-structured with clear sections, front-loading the purpose. It is slightly verbose but every sentence adds value, including details about blind spots and comparisons with other tools.

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?

Given three parameters, no output schema, and no annotations, the description covers most aspects: usage patterns, limitations, and relationship to edges_hook. The root parameter is not elaborated, but overall it is comprehensive.

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?

The description adds significant meaning beyond the input schema, especially for the name parameter (three distinct use cases) and entry_points. However, the root parameter is not explained, leaving a minor gap despite 0% schema coverage.

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 clearly states the tool dispatches WordPress hook/filter actions, showing the coupling between action/filter names and their listeners and fire sites. It distinguishes between different uses of the name parameter and differentiates from siblings like stats, scope, pending.

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?

The description provides explicit usage for three cases of the name parameter and explains the entry_points flag. It compares with edges_hook count and clarifies when the tool should be consulted. However, it does not explicitly state when not to use this tool versus alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Doublehead/codegraph'

If you have feedback or need assistance with the MCP directory API, please join our Discord server