Skip to main content
Glama

Find Usages of a Symbol

find_usages
Read-onlyIdempotent

Lists direct callers and references for a C# symbol before you change or delete it, replacing name-based grep with semantic usage results.

Instructions

List who uses a symbol: its direct fan-in. impact_of_change adds the closure and risk; calls_external covers external members.

Use it before changing or deleting a symbol, instead of grepping a C# name. What is listed depends on resolvedKind: 'type' - the types that reference it (a doc cref too, unmarked), plus markup views; 'method' - its callers, overloads unioned; 'property' or 'field' - its readers and writers; 'event' - its raisers and (un)subscribers; 'enum_member' - its references; 'operator' ('op_Equality') - its uses, casts too; 'constructor' ('Type.Type') - the type's construction and injection sites. Test users included.

Returns symbol, resolvedKind and usedBy, a capped envelope (items, count, totalFound, truncated; at most 100). An item is {name, file, line}, one per user: file is solution-relative, line where its declaration starts (not the reference); 'files' [{file, line}] for a type declared in several; absent if unknown; users sharing a name add 'fullName' (a type), 'project'. Optional members qualify it: 'note' ahead of the list (an empty answer, a constructor answer, or unresolved core references), 'namesakes' (several types share the name; usedBy unions them), 'collision' (a bare name: a same-named symbol of another kind, not counted), 'viaContract' + 'viaContractNote' (a qualified method: its contracts' callers), 'selfReferences' (users of a member on its own type), 'textuallyInvisibleUsers' (users whose source never names it), 'nearest' (on 'not_found': a close declared name).

An empty usedBy on a resolved symbol is not proof of dead code: an entry point, DI, reflection, a source generator and unrecorded markup forms leave no reference. 'not_found' is not 'undeclared': a delegate type and a qualified or nested type name answer it too; 'note' may say why.

Read-only. symbol is case-sensitive. A type takes its simple name. A member takes 'Type.Member' for one type's, or a bare name: that answers for ONE kind, the first in the order above with users, unioned over its same-named members.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesThe exact (case-sensitive) type, method, property, field, event, enum-member or operator (metadata) name - the qualified Type.Member form for a member - or 'Type.Type' for a type's CONSTRUCTOR (see the tool description: the answer is the type's construction/injection sites, overloads unioned).
sessionIdYesThe session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.46514
    • changedInput schema / properties / symbol / description
      Previous value: -"The exact (case-sensitive) type, method, property, field, event or enum-member name - the qualified Type.Member form for a member - or 'Type.Type' for a type's CONSTRUCTOR (see the tool description: the answer is the type's construction/injection sites, overloads unioned)."New value: +"The exact (case-sensitive) type, method, property, field, event, enum-member or operator (metadata) name - the qualified Type.Member form for a member - or 'Type.Type' for a type's CONSTRUCTOR (see the tool description: the answer is the type's construction/injection sites, overloads unioned)."
  2. 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."
  3. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnly, idempotent, non-destructive), and the description goes well beyond them: the capped envelope (at most 100, truncated flag), the meaning of empty results, namesake/collision semantics, selfReferences and textuallyInvisibleUsers, and not_found caveats. This is unusually rich disclosure for a read tool.

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

Conciseness3/5

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

Purpose and routing are correctly front-loaded, and most clauses carry genuine behavioral content, but the middle is a dense run-on of semicolon-chained enumerations (resolvedKind branches, envelope fields, optional members) that is hard to scan. It is informative but over-sized.

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, so the description must carry return semantics — and it does fully: top-level fields, the usedBy envelope, per-item shape {name, file, line}, multi-file declarations, fullName/project disambiguation, and all optional qualifier members. Nothing an agent needs to interpret the response is missing.

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 the schema already documents both parameters, but the description adds real meaning: how symbol resolves differently by resolvedKind (type/method/property/field/event/enum_member/operator/constructor) and the case-sensitivity constraint. It goes beyond the schema's restatement of the Type.Member/Type.Type forms.

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?

Opens with a specific verb+resource: 'List who uses a symbol: its direct fan-in.' It immediately distinguishes itself from siblings by naming impact_of_change (closure/risk) and calls_external (external members), so an agent can route correctly without opening any schema.

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?

States explicit when-to-use ('before changing or deleting a symbol'), when-not (instead of grepping a C# name), and the alternatives for the adjacent cases. It even covers edge conditions — empty usedBy is not proof of dead code, 'not_found' is not 'undeclared' — so the agent knows how to interpret negative results.

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