Skip to main content
Glama

find_references

Discover all references to a C/C++ symbol — calls, reads, member accesses, indirect function-pointer registrations, and template references.

Instructions

USE INSTEAD OF grep, ctx_search, or ctx_callgraph. Find ALL references to a C/C++ symbol — calls, reads, member accesses, function pointer registrations, and template references. grep and ctx_callgraph cannot see function-pointer registrations: NVIC_SetVector, mbed-os Timeout::attach, Ticker::attach, SerialBase::RxIrq, InterruptIn::fall/rise — all detected.

Read-only. No side effects. Returns every reference in the indexed codebase, including call sites, variable reads, struct member accesses, and indirect function-pointer references. Requires the reference index (fw-context index — refs on by default).

For direct callers only use find_callers. For transitive callers use find_all_callers_recursive. For call paths between two symbols use find_call_path.

Args: name: Symbol name to find all references of. project_root: Project root directory. Auto-detected if omitted. limit: Maximum results (default 50, max 200).

Returns: list of dicts, each with: file, line, ref_kind, caller, caller_kind. ref_kind is one of: "call", "ref", "member", "indirect" (function-pointer reference in arguments, assignments, initializers, or init lists), "template_ref".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesSymbol name to find all references of — calls, reads, member accesses.
limitNoMaximum results.
project_rootNoProject root. Auto-detected if omitted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description fully discloses behavioral traits: it is read-only with no side effects, requires a reference index, and returns every reference in the indexed codebase. It also details the kinds of references detected, including indirect function-pointer registrations.

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?

The description is well-structured, starting with a bold usage recommendation, then explaining functionality, listing alternatives, describing parameters, and outlining return values. Every sentence is informative and earns its place.

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?

The description covers all necessary aspects: it explains the return format (list of dicts with fields and ref_kind values), mentions prerequisites (reference index), and provides enough detail for an agent to use the tool correctly. An output schema exists, but the description still adds value.

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 100%, so baseline is 3. The description adds useful detail for the 'limit' parameter (max 200) and clarifies behavior for 'project_root' (auto-detected). This extra context justifies a score above baseline.

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?

The description clearly states the tool's purpose: 'Find ALL references to a C/C++ symbol — calls, reads, member accesses, function pointer registrations, and template references.' It uses a specific verb and resource and distinguishes from siblings like grep, ctx_search, and ctx_callgraph.

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?

The description explicitly tells when to use this tool instead of alternatives ('USE INSTEAD OF grep, ctx_search, or ctx_callgraph') and provides guidance for related tools: 'For direct callers only use find_callers. For transitive callers use find_all_callers_recursive. For call paths between two symbols use find_call_path.'

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/turbyho/fw-context-mcp'

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