Skip to main content
Glama

Find Calls to External APIs

calls_external
Read-onlyIdempotent

Finds code that calls external APIs by pattern to assess AOT/trimming readiness, security surface, or dependency footprint.

Instructions

Find the code that calls an EXTERNAL member - BCL or package - whose key contains 'pattern'. find_usages answers for solution symbols only; find_by_side_effects classifies the same calls into effect tokens.

Use it for AOT/trimming readiness, security surface or dependency footprint: pass the risky or external API as 'pattern', e.g. 'Process.Start' or 'DateTime.UtcNow'. It is the only search argument; there is no 'symbol'.

Returns scope, pattern, methodsScanned, matches - a capped envelope of at most 200 hits, sorted by type and name, not ranked - and testMatchesFiltered (units the test filter removed, outside methodsScanned; omitted at 0). A hit carries name, declaringType, namespace, matchedCalls (invoked methods and method groups, keys like 'System.IO.File.ReadAllText(string)') and matchedReads (external properties read or written, like 'System.DateTime.UtcNow'). The units scanned are methods plus every accessor and constructor with a body, under their metadata names (get_X, set_X, .ctor), and, unscoped, each top-level-statement file ('Program.cs (top-level)'); an initializer counts toward the constructor that runs it.

The pattern is a case-insensitive substring of the whole key, parameter list included, so a type name also hits the units that only pass that type to another API. It is an open vocabulary (no did-you-mean); empty is strong, not absolute. Not recorded: an external field read ('string.Empty'), a bare 'new X()', operators and conversions, indexers, event subscriptions and compiler-lowered calls (using, foreach, await). Cross-check a surprising empty against the declaring type ('DateTime', not 'DateTime.UtcNow'). A 'note' leads the answer when it is empty - it says when only the test filter emptied it - and when a project's core references did not resolve: an unresolved call records no key.

Read-only; works on a recalled session. Test-project code is excluded by default (includeTests=true includes it). scope is 'solution' or a namespace prefix, matched case-insensitively on segment boundaries.

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": {
      "sessionId": "<sessionId>",
      "pattern": "<pattern>"
    },
    "name": "calls_external"
  }
}

Input Schema

NameRequiredDescriptionDefault
scopeNo'solution' (default) or a namespace prefix (e.g. 'MyApp.Infrastructure') to narrow scope.solution
patternYesA substring of the external (BCL/third-party) call key to match (case-insensitive), e.g. 'Process.Start', 'File.', 'Assembly.Load', 'System.Reflection', 'JsonSerializer'. Required - a very broad pattern (e.g. 'System') truncates at 200.
sessionIdYesThe session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use.
includeTestsNoInclude test-project methods (default false - production focus; test setup/assertions calling external APIs would otherwise drown the signal).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.46513
    • changedInput schema / properties / sessionId / description
      Previous value: -"The session_id returned by analyze_solution."New value: +"The session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use."
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With annotations already declaring read-only, idempotent, non-destructive behavior, the description adds substantial operational context: capped results at 200, sorting rather than ranking, what each hit contains, which units are scanned, and what kinds of external references are not recorded. It also explains empty-result notes and test-filter behavior, giving the agent a realistic model of the tool's limitations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense and lengthy, but it is front-loaded with purpose and usage, and most sentences add concrete caveats an agent would otherwise miss. A few details repeat schema descriptions, and the density makes it harder to scan, keeping it just below the top score.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema, but the description explains the return envelope, hit fields, ordering, cap, and omitted fields. It also covers important edge cases such as note messages, unresolved references, top-level statements, and test filtering, making the definition complete for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema coverage is 100%, the description adds real meaning beyond the schema: pattern is a case-insensitive substring of the whole call key including parameter lists, it is an open vocabulary with no did-you-mean, empty results are strong but not absolute, and broad patterns truncate at 200. It also clarifies scope matching on namespace segment boundaries and the test-inclusion default.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb and resource ('find the code that calls an EXTERNAL member') and immediately distinguishes it from find_usages and find_by_side_effects. An agent can tell exactly what this tool searches and what it does not.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly names use cases (AOT/trimming readiness, security surface, dependency footprint) and gives concrete example patterns such as 'Process.Start'. It also clarifies that 'pattern' is the only search argument and there is no 'symbol', which prevents misuse.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.