code_callers
Find every caller of a method and the calls made inside it to assess impact before changing, renaming, or deleting it.
Instructions
Shows WHO calls a method and WHERE exactly, and what the method itself calls. CRITICAL for impact analysis. Returns caller locations (file, line, calling type and member, receiver) and the calls made inside the method. Use this BEFORE: changing a method signature (prevents breaking callers), modifying behavior, deleting a method, or renaming a method (find all references). Example: before changing GetUser(), verify which services depend on its parameter order. Callers are found by method NAME in the syntax index, then sorted by the declared type of their receiver: calls on an unrelated type are left out and counted (includeUnrelated=true lists them), and '?' marks a call whose receiver type is unknown. All overloads share one result. In TypeScript and JavaScript a local function (a handler or useCallback inside a React component) works too, and the calls inside it are reported under its own name, not its component's. For implementations and overrides of an interface or virtual member use code_types; to find the method's file first use code_search.
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": {
"workspace": "<workspace>",
"relativeFilePath": "<relativeFilePath>",
"methodName": "<methodName>"
},
"name": "code_callers"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Optional: page number, 1-based (default 1). Increment to see more callers. | |
| guide | No | true: put the code guide first in the result. Use on your first code call, or when told it changed. | |
| pageSize | No | Optional: callers per page (default 20, max 200). Use with 'page' when a method has many callers. | |
| className | No | Optional: class name when the file has several classes with this method; in TypeScript and JavaScript also the function (component, hook) that declares a local function | |
| workspace | Yes | Workspace name as shown in Waymark (a single workspace; '*' is not accepted) | |
| methodName | Yes | Method or function name to analyze (e.g. 'GetUser', 'ProcessOrder'). A Python class name, or '__init__', finds the calls that create the class. | |
| includeTests | No | Optional: include callers in test folders (default false, production code only; their number is reported) | |
| includeUnrelated | No | Optional: also list calls whose receiver is declared as an unrelated type, marked [on Type] (default false: they are only counted) | |
| relativeFilePath | Yes | Path of the source file (.cs, .py, .ts, .tsx, .js, .jsx and the like) that defines the method or function, relative to the workspace root (e.g. 'Services/UserService.cs') |