Skip to main content
Glama

Find semantic symbol references

ast_find_references
Read-onlyIdempotent

Locate type-resolved references across a TypeScript/JavaScript project and return bounded, project-relative file locations. Includes declaration impact by default so you can quickly assess where a symbol is used and affected.

Instructions

Finds type-resolved references and returns bounded project-relative locations, including declaration impact by default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum results to return (1-500).
offsetNoZero-based result offset.
file_pathYesFile containing the declaration.
symbol_pathYesExact symbol path returned by an outline or symbol search.
project_rootYesAbsolute project directory containing tsconfig.json, or the config path.
include_declarationNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitYes
totalYes
offsetYes
symbolYes
has_moreYes
referencesYes
next_offsetYes
affected_filesYes
reference_countYes
declaration_countYes
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=false, which covers the safety and scope profile. The description adds the note that results are 'bounded' (via limit) and that 'declaration impact' is included by default, which is useful context beyond the annotations. It doesn't discuss edge cases like unmounted files or config requirements beyond what params imply, but with strong annotation coverage the bar is lower.

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?

A single, dense sentence in the description that packs the verb, resource, filtering scope, bounded nature, and output format. It's front-loaded and every phrase carries meaning. No filler or redundancy.

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

Completeness4/5

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

With an output schema present, return-format explanation isn't needed. The tool has 6 parameters but 3 are simple pagination fields (limit, offset) covered clearly by schema descriptions. The description plus the schema's parameter descriptions plus strong annotations create a fairly complete picture. Minor gaps: no guidance on what happens when symbol_path is invalid, and the relationship to rename planning isn't stated—but given the strong supporting structure, this is adequate.

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

Parameters3/5

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

Schema description coverage is 83% (5 of 6 parameters have descriptions in the schema). The description itself adds little beyond schema: it clarifies the return is 'bounded project-relative locations,' which connects to limit/offset params. include_declaration is the only param without a schema description (coverage gap), and the description partially compensates by noting 'including declaration impact by default,' which maps to that param's default of true. This is baseline-adequate with mild value added.

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

Purpose4/5

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

The description states it 'Finds type-resolved references' and returns 'project-relative locations, including declaration impact by default.' This clearly identifies the verb (find references), the resource (semantic symbols), and the scope (project-relative). It distinguishes from sibling tools like ast_search_symbols (which finds symbols) and ast_get_symbol_source (which gets source), though it doesn't explicitly name alternatives.

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

Usage Guidelines3/5

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

The description implies usage for finding references to a symbol, and the symbol_path parameter notes it must be 'returned by an outline or symbol search.' This gives implicit guidance on prerequisite steps. However, there's no explicit when-to-use vs alternatives, nor mention that this is the correct tool for impact analysis/rename planning (ast_rename_symbol exists as a sibling).

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yailPeralta/ast-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server