Skip to main content
Glama

cpp_find_references

Find all usages of a C++ function, class, or variable in the indexed codebase. Provide the identifier and type to retrieve matching file, line, and snippet references.

Instructions

Find all usages of a C++ identifier across the indexed codebase.

Performs a pattern-aware search:

  • type='function' matches 'Identifier(' calls

  • type='class' matches word-boundary class references

  • type='variable' matches word-boundary variable references

Call cpp_set_codebase_path() first.

Args: identifier: Name to search for (e.g. 'HandleCommand', 'UUnrealMCPBridge'). type: 'class' | 'function' | 'variable'. Default 'function'. limit: Max hits to return. Default 100.

Returns: JSON StructuredResult with outputs: identifier, hits [{file, line, snippet}], total, truncated

KB: see knowledge_base/12_MCP_TOOL_USAGE_GUIDE.md#overview Example: cpp_find_references(identifier="Example")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNofunction
limitNo
identifierYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the pattern-aware search behavior (function calls vs word-boundary references), the return format (JSON StructuredResult with hits, total, truncated), and the prerequisite. It doesn't mention performance characteristics or failure modes, but the search semantics and output structure are well disclosed.

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 with clear sections: a one-line summary, a bulleted list of type behaviors, a prerequisite callout, an Args section, a Returns section, a KB reference, and an example. Every section earns its place and the most important information (what it does, prerequisite) is front-loaded.

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 tool has an output schema, so return values are documented. The description covers the prerequisite, parameter semantics, type-specific behavior, and output structure. For a search tool with 3 parameters and a clear output schema, this is complete. The KB reference adds further depth for agents that need it.

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. It does: it explains identifier with examples, type with its three allowed values and default, and limit with its default. It adds meaning beyond the schema by explaining what each type does and what the return structure looks like. Minor gap: no explicit statement that type values are case-sensitive or what happens with invalid values.

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 finds all usages of a C++ identifier across the indexed codebase, with a specific verb ('Find'), a resource ('C++ identifier across the indexed codebase'), and detailed pattern-aware search behavior for each type. It distinguishes itself from siblings like project_get_references and project_trace_reference_chain by focusing on C++ codebase references and requiring cpp_set_codebase_path() first.

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 states a prerequisite ('Call cpp_set_codebase_path() first'), which is critical usage guidance. It also explains the type parameter behavior, which tells the agent when to use which variant. While it doesn't name alternative tools for exclusion, the prerequisite and type-specific matching rules provide clear context for when to use this tool.

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

Deploy Server

Other Tools