find_callers

[callgraph]

Finds methods that call a given method. Requires a symbolKey.

Try this tool in Playground.

Parameters

NameTypeRequiredDescription
symbolKeystringYesOpaque symbolKey from search_symbols, resolve_symbol, get_symbol_at_position, or any tool that returns symbolKey. Not a name.
scopejsonNoOptional scope for call site search.
skipnumberNoPagination offset. Default is 0.
takenumberNoPagination size. Default is 200.
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root).
timeout_msnumberNoTimeout in milliseconds (5 minutes). Use 0 to disable. Default is 300000.

Examples

Find callers for a method

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_callers",
    "arguments": {
      "symbolKey": "..."
    }
  }
}
Response
{
  "success": true,
  "data": {
    "symbolKey": "...",
    "callerCount": 1,
    "paging": {
      "skip": 0,
      "take": 200,
      "returned": 1,
      "total": 1
    },
    "callers": [
      {
        "caller": {
          "name": "Login",
          "fullName": "MyApp.Controllers.AuthController.Login()",
          "symbolKey": "..."
        },
        "callSites": [
          {
            "filePath": "/path/to/AuthController.cs",
            "lineNumber": 58,
            "column": 12,
            "lineText": "await _service.LoginAsync(...);"
          }
        ]
      }
    ]
  },
  "error": null
}

Response Notes

Returns call sites grouped by caller (with paging)