Skip to main content
Glama

Codebase Function Read

codebase_function_read

Extract a single PHP function and its docblock from a module to review one hook or method without reading entire files. Returns the file path, line, and code.

Instructions

Extract a single PHP function (with its docblock) from a module.

Returns the file path, the line of the function and its code — enough to review one hook or method without reading whole files. Searches all PHP-ish files in the module, including class methods.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
moduleYes
function_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.1

TDQS

A3.8/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 usefully discloses search behavior ("Searches all PHP-ish files in the module, including class methods") and that it returns path/line/code, but says nothing about what happens when the function is not found or when multiple matches exist, and auth or size limits are unaddressed.

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 short sentences with zero padding; the core action is front-loaded and the scoping benefit follows immediately. Every sentence carries information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so explaining return values is not strictly required (though it does). With no annotations and 0% parameter coverage, gaps remain around edge cases and parameter formats for a lookup tool that can plausibly match zero or several functions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate and largely does not. It only implies that "module" identifies the module and "function_name" the function; it adds no format details (machine name vs. path, namespacing, qualified method names) needed to supply these values correctly.

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 ("Extract") and resource ("single PHP function (with its docblock) from a module"), and explicitly scopes it against reading whole files. An agent can tell it apart from codebase_file_read or codebase_hooks_find 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 Guidelines4/5

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

Implies when to use it ("enough to review one hook or method without reading whole files"), giving clear context and a soft contrast against whole-file reading. It stops short of naming an explicit alternative tool or stating exclusions.

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