Skip to main content
Glama

Symbol references

symbol_references
Read-only

Find every occurrence of a symbol name across one file or the workspace before renaming or changing it, with match counts, line numbers, and code context.

Instructions

Find occurrences of a symbol name. scope=file needs relative_path (one file); scope=workspace (default) searches all files. Use when: you check where a symbol is used before renaming or changing it. Avoid when: you only need its declaration (outline_symbol) or arbitrary text (search). Output: count (matches found), returned (how many came back), omitted (cut by the cap), scan_limit (workspace only), references[] {relative_path, line_number, context}.

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": {
      "symbol_name": "<symbol_name>"
    },
    "name": "symbol_references"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoscope=workspace only: how many workspace hits to SCAN (default: max_references, max 200). Not used for scope=file.
scopeNoworkspace = search all files (default); file = search one file. scope=file requires relative_path.
symbol_nameYesSymbol name to find (matched as a whole word).
relative_pathNoRequired when scope=file; with scope=workspace it narrows the search to this subtree.
max_referencesNoHow many references come BACK (default 100, max 500). Applies in both scopes; this is the token bill.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.0.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered; the description adds value with the default scope=workspace, the file-scope prerequisite of relative_path, and the scan-vs-return cap distinction. It also documents return fields (count/returned/omitted/scan_limit/references) that no output schema provides. Minor gap: no note on how truncation affects result trust beyond the omitted field.

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

Conciseness5/5

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

Four short lines, front-loaded with purpose, then usage routing, then output shape. No filler sentences; each clause carries either routing or contract information.

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?

For a five-parameter read-only search tool with no output schema, the description covers the mode selection, the file-scope requirement, the two distinct caps, and the full return field list. Nothing an agent needs to call it correctly is missing.

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 100%, so all five parameters are already documented, and the description largely restates the scope/relative_path relationship and the limit-vs-max_references split rather than adding new meaning. The "token bill" framing of max_references is a helpful emphasis, but the substantive semantics already live in the schema — baseline 3 applies.

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 specific verb and resource ("Find occurrences of a symbol name") and immediately scopes it by the two search modes. It explicitly names the siblings it is not (outline_symbol for declarations, search for arbitrary text), so an agent can distinguish it 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?

Provides an explicit "Use when" (checking usage before renaming/changing a symbol) and an explicit "Avoid when" naming the two alternative tools and their conditions. This is the full when/when-not/alternatives triad.

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