Browse documentation

get_outgoing_calls

[callgraph]

Find methods and constructors called within lexical method bodies, including nested functions. Optional invocation spans guide source reads for behavior and conditions.

Call-site windows, declaration keys and spans, and collection coverage remain unreleased. Check the installed schema for includeCallSites. Published 13.0.0 has no caller-span option.

Try it locally in the Glider playground

Parameters

NameTypeRequiredDescription
symbolKeystringYesExact opaque method key from discovery. Pass it unchanged.
depthnumberNoExpansion depth. 1 returns calls within the selected body. Default: 1
scopejsonNoOptional scope. Omit scope to search the solution. When supplied, set mode to solution, project, document, or pathPrefix. project requires projectName. document requires filePath. pathPrefix requires pathPrefix. Paths can be absolute or relative to solutionRoot. Set includeExternal to true when the tool supports external symbols.
skipnumberNoTarget rows to skip. Independent of callSiteSkip. Default: 0
takenumberNoTarget rows to take. Independent of callSiteTake. Default: 200
pathStylestringNoabsolute or relative to solutionRoot. Default: "absolute"
includeCallSitesbooleanNoInclude caller identities and exact invocation spans. Each target has a separate bounded window. Unreleased. Check the installed schema. Default: false
callSiteSkipnumberNoSites to skip for each target, in deterministic body traversal order. Keep other arguments unchanged. Unreleased. Check the installed schema. Default: 0
callSiteTakenumberNoSites to take for each target. Integer from 1 through 100. Follow each callSitePaging.nextSkip. Unreleased. Check the installed schema. Default: 30
responseDetailstringNocompact returns results and actionable state. full adds diagnostic metadata under responseDiagnostics. Default: "compact"

Examples

Replace sample paths and symbol keys with values from your workspace.

Find outgoing targets

Arguments
{
  "symbolKey": "<method key from find_code>",
  "depth": 1
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_outgoing_calls",
    "arguments": {
      "symbolKey": "<method key from find_code>",
      "depth": 1
    }
  }
}
Illustrative response
{
  "success": true,
  "symbolKey": "<caller key>",
  "fullName": "Acme.Orders.OrderService.Save()",
  "kind": "Method",
  "depthRequested": 1,
  "analyzedMethodCount": 1,
  "outgoingCallCount": 1,
  "outgoingCallCountIsFloor": false,
  "collectionCoverage": {
    "complete": true,
    "scope": "lexicalMethodBodies",
    "includesNestedFunctions": true,
    "analyzedMethodLimit": 250,
    "expansionLimitReached": false,
    "timedOut": false,
    "skippedBodyCount": 0,
    "unresolvedInvocationCount": 0
  },
  "scopeUsed": null,
  "paging": {
    "total": 1
  },
  "outgoingCalls": [
    {
      "symbolKey": "<constructed target key>",
      "fullName": "Acme.Orders.Store.Save<int>(int)",
      "kind": "Method",
      "projectName": "Orders.Api",
      "typeArguments": [
        "int"
      ],
      "depth": 1,
      "callSiteCount": 1,
      "callSiteCountIsFloor": false,
      "definition": {
        "symbolKey": "<declaration key>",
        "filePath": "/src/Store.cs",
        "lineNumber": 12,
        "projectName": "Orders.Api",
        "span": {
          "startLine": 12,
          "startColumn": 5,
          "endLine": 15,
          "endColumn": 6
        }
      },
      "callSites": [
        {
          "callerSymbolKey": "<caller key>",
          "callerFullName": "Acme.Orders.OrderService.Save()",
          "projectName": "Orders.Api",
          "filePath": "/src/OrderService.cs",
          "span": {
            "startLine": 20,
            "startColumn": 9,
            "endLine": 20,
            "endColumn": 27
          },
          "depth": 1,
          "attribution": "analyzedMethod",
          "containingCallableKind": "Ordinary"
        }
      ],
      "callSitePaging": {
        "skip": 0,
        "take": 30,
        "total": 1,
        "totalIsFloor": false,
        "returned": 1,
        "hasMore": false,
        "nextSkip": null,
        "collectionComplete": true
      }
    }
  ]
}

Locate invocations with an unreleased supporting build

Arguments
{
  "symbolKey": "<method key from find_code>",
  "includeCallSites": true,
  "callSiteTake": 10
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_outgoing_calls",
    "arguments": {
      "symbolKey": "<method key from find_code>",
      "includeCallSites": true,
      "callSiteTake": 10
    }
  }
}

Response Notes

The unreleased result extends outgoingCalls with constructed typeArguments and definition.symbolKey plus definition.span for the source declaration. Pass definition.symbolKey to source tools. A null definition means source is unavailable. Local callable keys are null with symbolKeyUnavailableReason=localCallable. Optional callSites contain callerSymbolKey, callerFullName, projectName, filePath, span, depth, attribution, and containingCallableKind. Lines and UTF-16 columns are one-based; ends are exclusive. attribution=analyzedMethod attributes nested lambda and local-function calls to the analyzed method. Spans locate syntax; read source for branch conditions. Collection covers lexical bodies and includes nested functions, with a 250-method limit. Constructors retain kind=Method. Compiler-recognized nameof expressions contribute neither calls nor unresolved invocations. User methods named nameof remain calls when the compiler resolves them. Check collectionCoverage.complete and its timeout, expansion, skipped-body, and unresolved-invocation fields. Incomplete collection marks outgoingCallCountIsFloor, callSiteCountIsFloor, and callSitePaging.totalIsFloor. Target paging and per-target callSitePaging are independent. Keep traversal arguments and the target page unchanged when following callSitePaging.nextSkip. Response limits can shorten either page. If no sites fit, follow guidance to reduce target take or increase the response limit. Page completion does not establish collection completeness. Results use top-level fields with success. Compact is the default; full adds responseDiagnostics. Both modes retain errors, coverage, partial state, and recovery advice.

For a failed symbol-key request, success=false includes errorCode, parameter, error, and suggestions in compact, full, and batch operation results. Batch keeps a bounded summary outside the requested detail budget. If the hard server limit omits details, failureDetailsOmitted or writeStateOmitted identifies the omission. errorCode is invalid_symbol_key, symbol_not_found, ambiguous_symbol_key, wrong_symbol_kind, source_unavailable, unsupported_symbol, or invalid_arguments. Follow the suggestions for the specific failure. Correct the named selector for invalid_arguments. For symbol_not_found, repeat discovery in the selected workspace and pass a returned key unchanged. An absent identity does not prove that a key is stale.