Skip to main content
Glama

magento_find_callers

Find all call sites of a PHP method across the codebase, searching for method patterns in PHP files and XML configs. Trace data flow and understand where a method is used.

Instructions

Find all call sites of a PHP method across the codebase. Searches for ->method() and ::method() patterns in PHP files and method references in XML config files. Use this to understand where a method is used and trace data flow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
classNameNoOptional: class that owns the method — narrows results to files that reference this class. Examples: "SalesRuleManagement", "CartRepository"
methodNameYesMethod name to find callers for. Examples: "execute", "save", "collectTotals", "copySalesRuleIdsFromParentToChildQuote"
Behavior2/5

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

With no annotations, the description must fully disclose behaviors. It mentions searching in PHP and XML files but omits whether the tool is read-only, any codebase scope limits, or performance considerations. This leaves significant gaps for an AI agent.

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, no wasted words. The first sentence states the core action, the second provides context and patterns. Highly efficient.

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?

The tool is complex (cross-codebase search), but the description does not explain output format (e.g., list of files with line numbers). Given no output schema, this omission reduces completeness. Parameter documentation is good, but behavioral context is lacking.

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 schema covers both parameters, and the description adds value by clarifying that className narrows results and providing examples for methodName. It also explains the search patterns (->method(), ::method()), which is beyond the schema.

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 finds all call sites of a PHP method, specifying patterns for PHP and XML. This distinctly sets it apart from siblings that find definitions or other artifacts.

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 says to use it to understand where a method is used and trace data flow, but does not provide explicit when-not-to-use guidance or mention alternatives like magento_trace_call_chain. The guidance is implied but not comprehensive.

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/krejcif/magector'

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