Skip to main content
Glama

explain_symbol

Explain any C/C++ symbol in plain English using libclang analysis, returning its purpose, inputs, outputs, and side effects without reading source code manually.

Instructions

USE INSTEAD OF reading code manually with grep/ctx_read. Explain what a C/C++ symbol does in plain English — libclang-aware analysis.

Read-only. No side effects — uses pre-computed LLM analysis when available (instant, generated during fw-context index --analyze), falls back to calling Ollama on-demand. Returns the symbol's purpose, inputs, outputs, and side effects.

For raw source code use get_source. For symbol metadata without explanation use lookup_symbol. For body + callers + callees use get_symbol_context.

Args: name: Symbol name to explain. E.g. uart_init, ModemMsg::send. project_root: Project root directory. Auto-detected if omitted. context_lines: Lines of source context around the symbol definition (default 40, max 200). Only used when no pre-computed analysis exists.

Returns: dict: {name, kind, file, line, signature, explanation, llm_analysis (if pre-computed)}, plus source/explain_prompt on fallback.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesSymbol name to explain. E.g. 'uart_init', 'ModemMsg::send'.
project_rootNoProject root. Auto-detected if omitted.
context_linesNoLines of source context around the symbol definition.
Behavior4/5

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

Read-only with no side effects, details on two execution paths (instant pre-computed vs. on-demand Ollama), and specifies return fields. Lacks mention of failure modes, rate limits, or auth requirements, but overall transparent.

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?

Well-structured with imperative opening, bullet-pointed behavior, sibling comparisons, and labeled Args section. Every sentence serves a purpose; no redundancy.

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

Completeness4/5

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

Covers purpose, behavior, fallback, and return structure adequately for a tool with moderate complexity and no output schema. Missing potential error return fields, but otherwise sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Adds significant value beyond the input schema: 'name' includes examples, 'project_root' notes auto-detection, 'context_lines' specifies default, maximum, and fallback-only usage. Schema coverage is 100%, but description enriches all parameters.

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?

Clearly states it explains C/C++ symbols in plain English, specifies libclang-aware analysis, and explicitly distinguishes itself from siblings like get_source, lookup_symbol, and get_symbol_context.

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?

Directly instructs to use instead of manual code reading and provides explicit alternatives for other needs: raw source (get_source), metadata without explanation (lookup_symbol), and body with callers/callees (get_symbol_context).

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