Skip to main content
Glama
Treeweft

treeweft-mcp

Official
by Treeweft

index_graph

Rebuild the code graph for an already-indexed source when graph-backed lookups return empty. Re-extracts entities and returns a job_id to poll for completion.

Instructions

Build (or rebuild) the Neo4j code graph for an already-indexed source — pass 2 of two-pass indexing. Use this when chunks/vectors exist but graph-backed tools (find_definition, find_callers, find_references, graph_explore) return empty, or after a chunks-only index (skip_graph=true). Drops the source's existing graph entities and re-extracts; safe to re-run. Returns immediately with a job_id; poll get_index_job. Get source_id from list_indexed_sources.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2026.9.23

TDQS

A4.9/5.0
Behavior5/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 clearly warns that it 'Drops the source's existing graph entities and re-extracts' – a destructive side effect – and further states it 'Returns immediately with a job_id; poll get_index_job', revealing the asynchronous nature. It also notes 'safe to re-run', which indicates idempotency. This is a thorough behavioral disclosure for a tool with no annotations.

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 compact and front-loaded: the first line states the purpose, then usage conditions, then behavior, then async handling, and ends with a concrete sourcing instruction. Every sentence adds value; no filler or repetition. It packs a lot of essential context into two sentences without becoming unwieldy.

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?

For a tool with one parameter, no annotations, and no output schema, the description covers all necessary aspects: what it does, when to use it, potential destructive behavior, async nature, how to track progress, and where to obtain the source_id. There is no missing information an agent would need to invoke or monitor this tool correctly.

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?

The schema only declares source_id as a required string with no description coverage, leaving the description to compensate. The description adds crucial meaning by indicating that source_id refers to an already-indexed source and explicitly instructs 'Get source_id from list_indexed_sources'. This goes beyond the schema, though it doesn't explain the ID format or any validation rules, but for a single param this is adequate.

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 states a specific verb ('Build (or rebuild)') and resource ('Neo4j code graph for an already-indexed source'), and immediately identifies this as 'pass 2 of two-pass indexing'. It distinguishes itself from siblings by explicitly referencing the graph-backed tools that return empty and by noting it operates on an already-indexed source, which sets it apart from index_file/index_directory/index_repo.

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 states when to use: 'when chunks/vectors exist but graph-backed tools return empty, or after a chunks-only index (skip_graph=true)'. Provides a prerequisite for obtaining source_id from list_indexed_sources and mentions the alternative of polling via get_index_job. This gives clear decision criteria and action steps.

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