Skip to main content
MCP Tools

get_callers

Return every call site of a symbol across the indexed repositories.

Input schema

{
"type": "object",
"required": ["symbol"],
"properties": {
"symbol": {
"type": "string",
"description": "Symbol name (e.g. 'PaymentService.charge') or qualified path (e.g. 'src/services/PaymentService.ts#charge')."
},
"repo": {
"type": "string",
"description": "Restrict search to a specific repo root. Omit to search all indexed repos."
},
"include_tests": {
"type": "boolean",
"default": true,
"description": "If false, exclude test files (files matching **/*.test.*, **/*.spec.*)."
},
"max_results": {
"type": "integer",
"default": 100,
"maximum": 500
}
}
}

Output schema

{
"type": "object",
"properties": {
"symbol": { "type": "string" },
"callers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": { "type": "string" },
"line": { "type": "integer" },
"column": { "type": "integer" },
"caller_fn": { "type": "string", "description": "The enclosing function/method name." },
"repo": { "type": "string" },
"snippet": { "type": "string", "description": "Source line at the call site." }
}
}
},
"total": { "type": "integer" },
"truncated": { "type": "boolean" }
}
}

Example

Request:

{
"symbol": "PaymentService.charge",
"include_tests": false
}

Response:

{
"symbol": "PaymentService.charge",
"callers": [
{
"path": "src/controllers/OrderController.ts",
"line": 142,
"column": 18,
"caller_fn": "OrderController.submit",
"repo": "/Users/me/my-project",
"snippet": "await this.paymentService.charge(order.amount, order.card);"
},
{
"path": "src/jobs/BillingJob.ts",
"line": 34,
"column": 6,
"caller_fn": "BillingJob.run",
"repo": "/Users/me/my-project",
"snippet": "await paymentService.charge(sub.amount, sub.paymentMethod);"
}
],
"total": 2,
"truncated": false
}

When to use

  • Before changing a method signature: find all callers so you know what to update.
  • Dead code detection: if total: 0 and include_tests: false, the symbol may be unused.
  • Impact analysis: see which subsystems call a piece of security-critical code.