Skip to main content
Glama
aimasteracc

tree-sitter-analyzer

by aimasteracc

index

Manage the project's code index lifecycle: check status, build or sync on-disk indexes, query the AST cache, and materialize a knowledge graph. Pick read-only or write capability via the action parameter.

Instructions

Code-intelligence (codegraph-compatible) index lifecycle hub. Covers codegraph_status, codegraph_full_index, codegraph_autoindex, codegraph_incremental_sync, AST cache query, and whole-project knowledge graph materialization in one tool. Pick a capability via action:

READ-ONLY:

  • action=status — check codegraph index health without writing (codegraph_status equivalent). Returns node/edge counts plus an owner-issued snapshot_id, source/index fingerprints, source_generation, and exact completeness enum. Params: access_mode=read_existing.

  • action=cache — query the raw AST cache for symbols, types, and references (read-only modes: search, lookup, stats, changes, watch_status). NOTE: this action ALSO exposes mutating cache modes via mode — index, sync, invalidate, watch_start, watch_stop (and force=true to force a reindex). Params: mode (default search/stats), query, file_path, kind, limit, force.

  • action=schema — index statistics: languages, symbol count, edge count, index age, available pulse fields, Hyphae pseudo-classes. Call before nav action=pulse. Params: (none).

WRITES ON-DISK INDEX:

  • action=build — full (re)build of the project index. Slow; use when index is absent or corrupt. Params: force.

  • action=full — force a complete full reindex (codegraph_full_index equivalent). Params: (none).

  • action=auto — enable/configure background auto-indexing (codegraph_autoindex equivalent). Params: enable, watch.

  • action=sync — run one incremental sync pass (fast; use after editing files, codegraph_incremental_sync equivalent). Params: paths.

  • action=knowledge — build/update/status for the code+docs knowledge graph sidecar and optional LadybugDB mirror. Params: mode, backend, max_files, max_nodes, max_edges, include_docs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoAction sub-mode (e.g. summary|cycles).
limitNoMax results.
queryNoSearch query/pattern.
scopeNoAction discriminator (e.g. point|graph).
actionYesWhich capability to invoke. One of: auto, build, cache, full, knowledge, schema, status, sync
symbolNoSymbol/function name.
languageNoLanguage hint (usually auto).
file_pathNoTarget file path.
access_modeNoStatus-only read mode; never creates or migrates an index.read_existing
function_nameNoFunction name (alias of symbol).
output_formatNoOutput format: JSON.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.30.0
    • addedInput schema / properties / access_mode
      Added value: +{
      +  "default": "read_existing",
      +  "description": "Status-only read mode; never creates or migrates an index.",
      +  "enum": [
      +    "read_existing"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / action / description
      Previous value: -"Which capability to invoke. One of: auto, build, cache, full, knowledge, status, sync"New value: +"Which capability to invoke. One of: auto, build, cache, full, knowledge, schema, status, sync"
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "auto",
      -  "build",
      -  "cache",
      -  "full",
      -  "knowledge",
      -  "status",
      -  "sync"
      -]New value: +[
      +  "auto",
      +  "build",
      +  "cache",
      +  "full",
      +  "knowledge",
      +  "schema",
      +  "status",
      +  "sync"
      +]
    • changedInput schema / properties / output_format / description
      Previous value: -"Output format (toon|json)."New value: +"Output format: JSON."
    • addedInput schema / properties / output_format / enum
      Added value: +[
      +  "json"
      +]
  2. Changed2 schema fields changedv1.29.1
    • changedInput schema / properties / action / description
      Previous value: -"Which capability to invoke. One of: auto, build, cache, full, status, sync"New value: +"Which capability to invoke. One of: auto, build, cache, full, knowledge, status, sync"
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "auto",
      -  "build",
      -  "cache",
      -  "full",
      -  "status",
      -  "sync"
      -]New value: +[
      +  "auto",
      +  "build",
      +  "cache",
      +  "full",
      +  "knowledge",
      +  "status",
      +  "sync"
      +]
  3. First observedv1.23.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations are coarse (readOnlyHint=false for the entire multipurpose tool), so the per-action read/write split is genuinely additive: it warns that action=cache also exposes mutating modes (index, sync, invalidate, watch_start/stop, force=true reindex), that build is 'slow', and that status is a non-writing read. This is exactly the disclosure an agent needs to avoid an unintended write.

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 hub concept is front-loaded, and the READ-ONLY / WRITES grouping with per-action bullets is easy to scan. It is dense and repeats the codegraph_* aliases and some param lists across lines, which costs a little, but almost every sentence carries routing information.

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?

For an 11-param, 8-action tool with no output schema, the description does the heavy lifting well, including partial return-shape notes (node/edge counts, snapshot_id, completeness enum for status). It still leaves a few parameters (scope, symbol, language) unmentioned in any action context, so it is not fully exhaustive, but it is comfortably complete enough to invoke 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?

Schema description coverage is 100%, so the baseline is 3, but the description adds real value by listing which params apply to each action (e.g. status→access_mode=read_existing, auto→enable/watch, sync→paths, knowledge→mode/backend/max_files) and calling out force=true semantics. It does not cover scope, symbol, language, or output_format, but the action-param mapping exceeds what the flat schema conveys.

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 concrete role (code-intelligence index lifecycle hub) and enumerates each capability by name with a verb+resource gloss (status, build, full, auto, sync, knowledge, cache, schema). It even maps actions to the legacy tool names they replace (codegraph_status, codegraph_full_index, etc.), so an agent knows exactly what each branch does without opening the schema.

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?

It gives explicit when-to-use guidance for key actions: build 'when index is absent or corrupt', sync 'fast; use after editing files', schema 'call before nav action=pulse'. The READ-ONLY vs WRITES ON-DISK INDEX grouping also steers selection. However, several actions (auto, knowledge, cache modes) have no stated conditions for use or exclusions against alternatives, so it stops short of a full when/when-not map.

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