Skip to main content
Glama

All usages of a declaration (LayerMap)

project_find_references
Read-onlyIdempotent

Find every usage of a declaration—calls, imports, re-exports, reads, writes—compiled from current source, so you can trace impact across aliases and references.

Instructions

Use this to list every place a declaration is used (calls, imports, re-exports, reads and writes), compiled from current source: more complete than searching for its name. Compute usages of a mapped declaration from current source, including aliases, re-exports and non-call references. Select it with symbol {path,name,line?} as printed by project_explore_map or project_search_map (line is its start line when names repeat), or with an entityRef or locator {path,start,kind}. Broader and more expensive than the cached callers in project_explore_map; file or unsupported declarations may lack a reference target. path and kinds filter usage locations before paging. objects contains compact declarations; targetRef and reference ownerRef identify them. Read a reference at its line range. A file that several compiler contexts read (such as packages of one workspace) lists its references once per context, each with that context's configPath. Continue with nextCursor and unchanged conditions, including after an empty partial page. Filtered exhaustion and missing results do not prove absence.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoFilter usage locations; compiler inputs and declarations may lie elsewhere in the project..
kindsNo
cursorNo
symbolNoDeclaration as printed by the map: file path, name or Container.member, and start line when names repeat.
locatorNoDeclaration location: path and UTF-16 start offset; include kind to distinguish declarations at the same offset.
entityRefNo
maxResultsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations it discloses real behavioral traits: results are compiled from current source, a file read by several compiler contexts lists references once per context with that context's configPath, pagination continues via nextCursor even after an empty partial page, and 'filtered exhaustion and missing results do not prove absence.' That is substantial context the annotations cannot convey.

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?

Purpose is front-loaded and every sentence earns its place, but the content is packed into a single dense paragraph mixing usage, selectors, paging, and output notes. Bullets or a short structure would make it easier to scan for a 7-parameter tool.

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?

For a complex tool with no output schema and 43% schema coverage, the description covers the critical ground: output shape (objects contains declarations, targetRef/ownerRef identify them), reading a reference at its line range, per-context duplication, and paging. A couple of edge behaviors (e.g., maxResults limits, error modes) are left implicit.

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 only 43%, so the description must carry weight, and it does: it explains that path and kinds filter usage locations before paging, defines the symbol {path,name,line?} and locator {path,start,kind} selector shapes, and connects cursor to nextCursor. maxResults is only implied through paging language, leaving one minor gap.

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 and resource ('list every place a declaration is used' enumerating calls, imports, re-exports, reads and writes) and explicitly separates itself from name-search and from the cached callers in project_explore_map. An agent can distinguish it from both siblings without opening a 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?

Gives explicit when-to-use ('Use this to list every place a declaration is used') and names the alternatives: preferring search-by-name is discouraged because this is 'more complete', and project_explore_map is called out as the cheaper cached option. It also states the selector entry points (symbol, entityRef, locator) and the caveat that file/unsupported declarations may lack a reference target.

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