Skip to main content
Glama

Find Calls to External APIs

calls_external
Read-onlyIdempotent

Find code calling external BCL or package members by pattern to assess AOT/trimming readiness, security surface, and dependency footprint.

Instructions

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

Use it for 'who calls the risky or external API X?': AOT and trimming readiness, security surface, dependency footprint (pattern 'Process.Start', 'Assembly.Load', 'DateTime.UtcNow').

Returns scope, pattern, methodsScanned, matches - a capped envelope of at most 200 hits, sorted by type and name, not ranked - and testMatchesFiltered when the test filter removed hits. 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); 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: there is no did-you-mean, and empty is now a strong statement, though 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' instead of '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. testMatchesFiltered counts the filtered-out units, which methodsScanned does not include. scope is 'solution' or a namespace prefix, matched case-insensitively on segment boundaries.

Input Schema

TableJSON 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.8/5.0
Behavior5/5

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

Annotations cover only safety (readOnly/idempotent/non-destructive), but the description goes far beyond: it defines the scanned units (methods, accessors, constructors with bodies under metadata names), declares the open vocabulary with no did-you-mean, warns that empty is a strong but not absolute statement, and enumerates exactly what is NOT recorded (field reads, bare constructors, operators, indexers, event subscriptions, compiler-lowered calls).

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 purpose and usage scenario are front-loaded, and the dense caveat list is justified by the tool's many non-obvious edge cases. It is long and could be tightened, but nearly every sentence carries operational information an agent needs.

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?

There is no output schema, yet the description fully specifies the return envelope (scope, pattern, methodsScanned, matches, 200-hit cap sorted not ranked, testMatchesFiltered, the note field) and the per-hit structure (name, declaringType, namespace, matchedCalls, matchedReads).

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds real meaning: the pattern is a case-insensitive substring of the whole key including the parameter list, that type names also hit units merely passing that type, that broad patterns truncate at 200, and how testMatchesFiltered relates to methodsScanned.

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?

States a precise verb+resource+scope ('Find the code that calls an EXTERNAL member - BCL or package - whose key contains a pattern') and explicitly differentiates from siblings, noting find_usages covers solution symbols only and find_by_side_effects classifies the same calls into effect tokens.

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?

Gives explicit when-to-use scenarios ('who calls the risky or external API X?': AOT/trimming readiness, security surface, dependency footprint) with concrete example patterns, and names the alternatives (find_usages, find_by_side_effects) that answer different questions.

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