Skip to main content
Glama

find_references

Locate all usages of a function, class, or symbol in a codebase, with optional filters for call, import, or inheritance references.

Instructions

Find all usages of a function, class, or symbol in the codebase.

Args:
    symbol: The name of the function/class/variable to search for
    directory: Path to the codebase directory to search
    ref_type: Optional filter: 'call', 'import', 'inherit' (empty for all)

Returns:
    List of locations where the symbol is used

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": "<symbol>",
      "directory": "<directory>"
    },
    "name": "find_references"
  }
}

Input Schema

NameRequiredDescriptionDefault
symbolYes
ref_typeNo
directoryYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It discloses the return shape (a list of locations) and the filter semantics, but says nothing about whether the directory must first be indexed (siblings index_directory/sync_index suggest it might), how large result sets are handled, or what happens when the symbol is not found.

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?

Front-loaded with the core purpose in a single sentence, followed by a scannable Args block. The Returns section is mildly redundant given an output schema exists, but it costs little and does not obscure the tool's function.

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

Completeness3/5

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

With an output schema present, the return-value explanation is optional, and all parameters are covered. What is missing is the relational context: with many sibling tools that query code, the definition never states how this tool differs or what preconditions (indexing state) apply.

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 description coverage is 0%, so the description must compensate, and it largely does: all three parameters are documented, including the three accepted ref_type values and the empty-string default meaning 'all'. It stops short of stating whether symbol matching is exact or substring, or whether directory must be absolute.

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?

States a specific verb and resource: 'Find all usages of a function, class, or symbol in the codebase.' An agent immediately knows this is a reference-search tool. It does not, however, distinguish itself from siblings that also locate code (get_symbol_definition, get_call_graph, super_grep), so the agent must infer the boundary.

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 ref_type filter ('call', 'import', 'inherit') implies usage contexts, and 'Find all usages' hints at the use case. But there is no explicit when-to-use or when-not guidance, and no pointer to alternatives such as get_call_graph when the caller only wants call edges.

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