Skip to main content
Glama

find_callers

Finds every caller of a method or function, showing file, method, line range, and call-site line; use depth 2–5 for impact analysis and regex patterns for broad or exact matches.

Instructions

Who calls it: file, method, line range and the call's own line (L25 │ code) of each caller; paths are relative to the root: line. Start with the name pattern (regex) (^|::|\.|->)cancel$: it finds every call, also with an unknown/inherited receiver. Order::cancel lists only calls resolved to that type (via <Type> = through its interface/parent/trait), so it can miss callers; ?::name = name-only match. depth 2–5 = impact analysis (callers of callers); guess adds name-only matches (?). Example: {"pattern": "(^|::|\.|->)cancel$", "path": "app"}.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pattern": "<pattern>"
    },
    "name": "find_callers"
  }
}

Input Schema

NameRequiredDescriptionDefault
fullNoDisable the 400-line output cap.
pathNoSearch scope (file or directory) relative to the project root; default: the whole root.
depthNo1 (default) = direct callers; 2–5 = callers of callers (impact analysis).
guessNoAlso follow name-only matches (marked `?`).
layerNoSearch only files of this layer (level 1), e.g. `controller`.
patternYesWhat is called (regex on the callee): start with `(^|::|\.|->)cancel$` (every call of the name); `Order::cancel` = only calls resolved to that type; JS keys: `useForm.js::submit`, `route::orders.show`.
projectNoRegistered project alias; default: the server's working directory.
by_layerNoGroup callers by layer (closest to the callee first), each group under a `[service] 3 callers` header.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.9.3

TDQS

A4.2/5.0
Behavior4/5

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

No annotations, so the description carries the load, and it does disclose real behavior: the shape of returned rows, that `via <Type>` means resolution through an interface/parent/trait, that `?` marks name-only matches, and that type-qualified patterns are lossy. It omits pagination/truncation context (the 400-line cap lives only in the `full` param).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Every clause carries information and the return shape is front-loaded, but the prose is densely packed with backticked tokens and regex fragments, making it hard to parse on first read. Slight restructuring (separate sentences for pattern strategy vs. output) would improve scanability without adding length.

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 an 8-parameter tool with no output schema, the description supplies the return format, the pattern grammar, and the precision/recall tradeoffs that matter most. The four parameters it skips are self-describing in the 100%-covered schema, so nothing critical is missing.

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 coverage is 100%, so baseline is 3, but the description adds interpretive value: it prescribes the regex shape for `pattern`, gives a concrete worked example object, and explains that `depth` 2–5/`guess` trade precision for recall. It leaves `layer`, `by_layer`, `project`, and `full` to 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?

Opens with a specific verb+resource ('Who calls it') and immediately enumerates the returned data (file, method, line range, call line, relative paths). An agent can tell this is a call-graph reverse-lookup, distinct from outline/search/method_body, without opening the 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?

Gives explicit starting guidance ('Start with the name pattern ... it finds every call'), explains when a qualified pattern is appropriate, and notes the tradeoff that `Order::cancel` 'can miss callers'. It also frames depth 2–5 as impact analysis. It does not name sibling tools as alternatives, which keeps it from a 5.

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