Skip to main content
Glama

get_symbol_context

Retrieve the body, signature, and all direct callers and callees of a C/C++ symbol to understand its purpose and system integration in one response.

Instructions

USE INSTEAD OF ctx_compose, grep, or manual code reading. Rich one-shot context for a C/C++ symbol: body, signature, all direct callers and callees. Answers "what does this do and how does it fit in the system?" in a single response — libclang powers the call graph, not regex.

For body-only use get_source (faster). For transitive call-graph exploration use find_all_callers_recursive or find_callees_recursive.

By default, SDK/vendor callers and callees are filtered out for clarity. Use project_only=False to see all callers/callees.

Returns dict with: name, qualified_name, kind, file, line, signature, is_definition, callers (list), callees (list), source (body text), indirect_call_sites (list, for field/variable symbols — where the function pointer is actually invoked). For field and variable symbols that have function pointer type, also includes resolution: {assignments_found, call_sites_found, resolved, note} indicating whether assignments and call sites are linked (Phase 3). resolved=False with a note when parts are missing — LLM can detect uncertainty. For enums also returns constants and enum_value. When LLM analysis has been generated (fw-context index --analyze), includes llm_analysis: {summary, inputs, outputs, model, analyzed_at} with a structured description of the symbol's purpose, parameters, and return values/side effects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesSymbol name. Returns body, signature, all direct callers and callees.
project_onlyNoWhen True (default), filters callers and callees to project paths (excludes SDK/vendor).
project_rootNoProject root. Auto-detected if omitted.
Behavior5/5

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

No annotations provided, but the description discloses key behavioral traits: uses libclang (not regex), filters out SDK/vendor by default, describes return structure including indirect call sites, resolution status for function pointers, enum values, and LLM analysis. Transparent about uncertainty with 'resolved=False.'

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?

The description is somewhat long but well-structured with clear sections and front-loaded key information. Every sentence adds value; could be slightly more concise but remains efficient.

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?

Despite no output schema, the description fully explains the return value structure, including edge cases for field/variable symbols, enums, and LLM analysis. Covers all relevant aspects for a complex tool.

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 100%, baseline 3. The description adds value by explaining the effect of 'project_only' (filters SDK/vendor) and the context of 'name' parameter (returns body, signature, callers, callees). Also clarifies default behavior and auto-detection of project_root.

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 provides rich context for a C/C++ symbol: 'body, signature, all direct callers and callees.' It effectively distinguishes from siblings like get_source (body-only) and recursive tools.

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?

Explicitly advises using this tool instead of alternatives like ctx_compose, grep, or manual code reading. Provides clear when-to-use guidance and mentions specific alternatives for different needs (e.g., get_source for body-only, recursive tools for transitive exploration).

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