gograph_callers
Finds the functions and methods that call a specified Go function or interface method, with optional caller depth, so you can assess upstream usages before renaming or changing signatures.
Instructions
Find functions and methods that call the specified function or interface method. Defaults to one-hop fan-in; depth 2-10 expands callers-of-callers. In a precise graph, Interface.Method expands through all recorded implementations and reports a shared source call site once. In an AST graph, a method call whose receiver type is spelled in the calling function (receiver, typed parameter or var, composite literal, then struct fields), or that is called directly on T{}, new(T) or x.(T), is not matched to a same-name method of another type, and a receiver of a package outside the graph (bytes.Buffer) matches no repository method; unknown receivers stay candidates. WHEN TO USE: Before renaming, removing, or changing a function or interface method signature. NOT TO USE: For unbounded upstream blast radius (use gograph_impact); for downstream callees (use gograph_callees). RETURNS: Caller symbols with package paths, file locations, and call-site line numbers; with mermaid=true, Mermaid flowchart text.
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": {
"function": "<function>"
},
"name": "gograph_callers"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | No | Absolute path of your checkout or worktree (alias cwd). | |
| depth | No | Traversal depth from 1 to 10 (default 1) | |
| exact | No | Require an exact symbol-name or fully-qualified-ID match | |
| limit | No | Rows per page. | |
| cursor | No | next_cursor from the previous page. | |
| mermaid | No | Return Mermaid flowchart text instead of the normal response | |
| function | Yes | The target function or method (supports short name 'BuildGraph', interface notation 'Repository.Delete', concrete dot-notation 'Store.Delete', or a fully-qualified ID) | |
| no_tests | No | Exclude call edges originating in *_test.go files | |
| intention | No | Rationale; required with an active session. | |
| session_id | No | Session from session_create; omit for none. |