Skip to main content
Glama

reindex_file

Re-parse a source file after editing to update symbol index, avoiding full rebuild. Regenerates LLM analysis when enabled.

Instructions

Re-parse a single source file with libclang and update its symbols in the index.

Not read-only — uses the exact compiler flags from compile_commands.json. The file must be listed in compile_commands.json (headers are re-indexed via the translation unit that includes them). Use after editing a file to keep the index current without a full rebuild.

Also regenerates LLM analysis and method override relationships for affected symbols when those features are enabled in config.

Args: file_path: Path to source file to re-parse. Must be in compile_commands.json. project_root: Project root directory. Auto-detected if omitted.

Returns: dict: {file, translation_units, symbols_updated, elapsed_s, analysis_updated (if LLM enabled), or error}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesPath to source file to re-parse. Must be in compile_commands.json.
project_rootNoProject root. Auto-detected if omitted.
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. It clearly states the tool is not read-only, uses compiler flags, and has side effects (regenerates LLM analysis and method overrides). It also mentions the return dict includes an error field, adding transparency. Could be improved by noting potential blocking or performance impact, but still strong.

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 well-structured with a clear purpose, usage context, and a bullet list for return values. It is concise without unnecessary information. Slightly longer than ideal but each section serves a purpose.

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?

Given the tool's moderate complexity (2 params, no output schema, no annotations), the description provides complete information: what it does, when to use, preconditions, behavior, side effects, and return structure. An agent can confidently use this tool based on the description alone.

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 the schema already documents both parameters. The description adds value by explaining that 'file_path' must be in 'compile_commands.json' and that 'project_root' can be auto-detected, going beyond the schema's basic descriptions.

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 starts with a specific verb+resource: 'Re-parse a single source file with libclang and update its symbols in the index.' It distinguishes itself from siblings like 'reset_index' (full rebuild) and 'get_file_analysis' (read-only) by mentioning use of exact compiler flags and that headers are re-indexed via translation unit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use: 'Use after editing a file to keep the index current without a full rebuild.' It also provides a key precondition: the file must be in 'compile_commands.json'. However, it does not explicitly state when not to use or give alternatives, though sibling tools provide some 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