Skip to main content
Glama

Codebase Hooks Find

codebase_hooks_find

Locate which local Drupal modules implement a given hook, reporting the file and line for each implementation. Accepts hook names with or without the hook_ prefix.

Instructions

Find which local modules implement a hook, with file and line.

Accepts the hook with or without its 'hook_' prefix (both 'form_alter' and 'hook_form_alter' work). Implementations are reported per module with the file and line of the function.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hook_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.1

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It does disclose the useful behavioral detail that the hook prefix is optional and that results are grouped per module with file/line, which is real context. It stops short of stating whether this is a read-only inventory across all enabled modules or how large result sets behave.

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?

Two short sentences, front-loaded with the outcome and followed by the input-format note. No wasted clauses, though the line-wrap breaks interrupt an otherwise tight statement.

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?

An output schema exists, so return-shape detail is not required, and the description covers purpose plus the single input nuance. It omits any scope caveat (e.g., enabled vs. all modules) and any alternative, leaving a small but real gap.

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 description coverage is 0% for the single hook_name parameter, so the description must compensate, and it does: it explicitly says the hook may be supplied with or without the 'hook_' prefix, which is the one non-obvious input fact. One-parameter tools anchor this near the 4 baseline.

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 (Find) and a precisely-scoped resource: local modules that implement a given hook, returning file and line. That scope is clearly distinguishable from siblings like codebase_function_read or module_hook_implement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when this tool applies (you want to locate hook implementations), but it names no alternative and gives no when-not guidance. A sibling like module_hook_implement could plausibly overlap, and the reader gets no routing help.

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