Skip to main content
Glama
aimasteracc

tree-sitter-analyzer

by aimasteracc

🌳 Tree-sitter Analyzer

English | 日本語 | 简体中文

PyPI Python License Coverage Stars Works with Claude Code · Cursor · MCP

Code intelligence AI agents can trust — correct cross-language structure across 20+ languages, agent-native (MCP + CLI).

TSA indexes your codebase with tree-sitter and serves correct call graphs, symbol search, and structural queries to AI coding agents — locally, with no telemetry.

Why it's different:

  • Cross-language correctness is the moat. A name-only index wires Python sorted() to a Swift func sorted. TSA doesn't. ~390× fewer cross-language call-graph mis-wires than alternatives (reproducible audit).

  • Built agent-native. 8 MCP tools, TOON output (~half the size of JSON on bulk/tabular responses), verdict envelopes, and 13 curated Skills — designed for Claude Code, Cursor, and any MCP client.

  • Broad and correctly classified. 13 languages with full call-graph indexing (Python · Go · Rust · Java · JS · TS · C · C++ · C# · Swift · Kotlin · Ruby · PHP), 8 more symbol-indexed or CLI-reachable.

Proof: on HuggingFace tokenizers (Rust+Python+JS+TS), a name-only resolver mis-wires 1,259 call edges — TSA: 0. Run it on your repo in seconds: uvx --from tree-sitter-analyzer miswire-audit .

Upgrading from v1.x? See docs/MIGRATION.md.


Get Started

Requires Python 3.10+ (check: python3 --version). Install from python.org if needed.

curl -fsSL https://raw.githubusercontent.com/aimasteracc/tree-sitter-analyzer/main/install.sh | bash

Auto-installs uv if missing, detects Claude Desktop / Claude Code / Cursor / VS Code, and writes the MCP entry. Run tree-sitter-analyzer --doctor to verify. One-line install for Claude Code:

claude mcp add tree-sitter-analyzer \
  --env TREE_SITTER_PROJECT_ROOT="$PWD" \
  -- uvx --from "tree-sitter-analyzer[mcp]" tree-sitter-analyzer-mcp

Restart your agent, then say: "Run the index tool with action=status." CLI equivalent (no agent needed): tree-sitter-analyzer --codegraph-status

PyPI / uvx users — install skills: the 13 tsa-* skills are bundled in the wheel. Copy them once with:

tree-sitter-analyzer --install-skills              # into ./.claude/skills/ (this project)
tree-sitter-analyzer --install-skills-global       # into ~/.claude/skills/ (all projects)

Git-clone users already have them under .claude/skills/ — no action needed.

Other agents (Cursor, Copilot, Cline, Continue, Claude Desktop, Roo Code) →

Quick install

1. Install dependencies

# uv (required)
curl -LsSf https://astral.sh/uv/install.sh | sh        # macOS / Linux
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"  # Windows

# fd + ripgrep (required for `search action=content` text search; symbol search uses SQLite FTS5 and needs neither)
brew install fd ripgrep                                # macOS
winget install sharkdp.fd BurntSushi.ripgrep.MSVC      # Windows

2. Install Tree-sitter Analyzer

# Standalone install (persistent CLI command):
uv tool install "tree-sitter-analyzer[all,mcp]"
# — or skip installing entirely: the MCP entry below runs via uvx on demand.
# Inside a uv-managed Python project, use: uv add "tree-sitter-analyzer[all,mcp]"

3. Hook it into your agent

See Supported Agents. Most clients want this MCP server entry:

{
  "mcpServers": {
    "tree-sitter-analyzer": {
      "command": "uvx",
      "args": ["--from", "tree-sitter-analyzer[mcp]", "tree-sitter-analyzer-mcp"],
      "env": { "TREE_SITTER_PROJECT_ROOT": "/absolute/path/to/your/project" }
    }
  }
}

After restart: "Run the index tool with action=status." CLI equivalent (no agent needed): tree-sitter-analyzer --codegraph-status

See the correctness edge on your own repo — no install, no CodeGraph (it re-indexes first; seconds on a small repo, a minute or two on a large one):

uvx --from tree-sitter-analyzer miswire-audit .

It prints how many call edges a name-only code index (the design most tools use) would mis-wire across a language boundary — e.g. a Python sorted() wired to a Swift func sorted — versus how many TSA does (≈0). On HuggingFace tokenizers: 1,259 → 0.


Related MCP server: codemap

Why Tree-sitter Analyzer

  • Token-efficient on bulk output. Every MCP response uses TOON, a tabular JSON variant that cuts bulk/tabular payloads by roughly half vs raw JSON (measured invariant). Note: small metadata-heavy decision-tool responses are currently ~equal-to-larger than JSON under the present envelope wiring — tracked by a strict-xfail invariant and being corrected in RFC-0018.

  • Verdict envelopes. Every response carries verdict: SAFE | CAUTION | UNSAFE | INFO | REVIEW | WARN | ERROR | NOT_FOUND, so orchestrators branch on outcomes without re-prompting.

  • Project health grading (A–F). Few code-intel tools expose a whole-project quality grade — TSA grades on size / complexity / coverage / duplication / dependencies / structure / git-hotspots in one call.

  • 13 curated workflows (Skills). Pre-baked tool subsets for "find symbol", "trace call chain", "score health", "safe-to-edit before refactor", "PR review", etc.

  • 5 layers of safety. edit action=safe + edit action=guard + constraint DSL + edit action=impact + verdict envelopes — designed so agents know before they touch.

  • Strict CLI superset of CodeGraph, faster indexing, and a one-call query DSL — with an honest cost comparison (below).


Key Features

Pre-indexed code intelligence (CodeGraph parity + superset)

Capability

TSA tool

Status

Symbol search (FTS5 + BM25 ranked)

search action=symbol

ahead — results sorted by relevance score, not file path

Go-to-def / find-refs / call hierarchy in one call

nav action=navigate

PRIMARY entry point

Bulk-fetch N related symbols + relationship map

structure action=explore

parity

Function-level blast radius + risk score

nav action=impact

parity + risk score

Who-calls-X / what-X-calls

nav action=callers / action=callees

parity

Index health at-a-glance (+ edge count)

index action=status

ahead — reports total_edges for graph density signal

Pre-built call graph cache

index action=auto / action=full / action=sync

parity

Tests affected by a change (CLI)

--affected FILE...

parity

Tree-sitter Analyzer exclusive

Capability

TSA tool

Note

BM25-ranked symbol search

all search tools

relevance_score on every result (min-max normalized: best=1.0, weakest=0.0); sort(by='confidence') in DSL

Semantic search (BM25 pre-filtered)

search action=chain (semantic() DSL)

BM25 pre-filter narrows 40k symbols to ~400 before cosine rerank

Project A–F health grading

health action=project

7 dimensions (size/complexity/deps/coverage/duplication/structure/git-hotspot), uncommon among code-intel tools

TOON output

every tool, output_format: "toon" (default)

~50 % token saving on bulk/tabular output (decision tools tracked by RFC-0018)

Verdict envelopes

every tool

SAFE/CAUTION/UNSAFE/INFO/WARN/ERROR/NOT_FOUND

Safe-to-edit gate

edit action=safe / action=guard

refuses high-risk edits before they happen

Architectural constraint DSL

edit action=constraints

"module A cannot import B" → enforced

Code health (file-level)

health action=file

block/long-method/smell detection

Class hierarchy

structure action=class_tree

type-inheritance tree

Dependency matrix

health action=matrix

module-coupling matrix

Dead code

health action=dead

transitive unreachable analysis

Complexity heatmap

health action=heatmap

per-fn cyclomatic + project view

AST-structural clone detection

viz action=similarity

beyond text similarity

Mermaid call-graph export

viz action=graph

paste-ready in docs

UML Mermaid export

viz action=uml

class / package / component / sequence diagrams

PR review

edit action=pr

AST-diff + semantic classify + blast radius

agent_summary

every response

next-step hint baked into the envelope

Synapse cross-file resolver

internal

import-aware, beats regex guessing

Temporal activation

nav action=lineage

per-symbol git-modification frequency

One-shot file orientation

project action=smart

health + exports + deps + edit-risk in one call (replaces 3-4 calls)

Architectural decision journal

project action=journal

persists reasoning across sessions — uncommon among code-intel tools

Skills (13 curated workflows)

CodeGraph has zero skills. We ship 13 under .claude/skills/tsa-*/:

tsa-landing, tsa-find, tsa-graph, tsa-structure, tsa-deps, tsa-index, tsa-health-watch, tsa-edit-safety, tsa-edit-then-verify, tsa-constraints, tsa-pr-review, tsa-refactor-queue, tsa-temporal.

Each skill ships an allowed-tools subset + procedure recipe + decision-surface schema, so the agent doesn't have to triage 8 tools on every question.

321 CLI flags

Superset of CodeGraph's CLI surface. Highlights:

tree-sitter-analyzer --table full <file>          # method/signature/complexity table
tree-sitter-analyzer --partial-read --start-line N --end-line M <file>
tree-sitter-analyzer --project-health             # A-F grade across the project
# Note: --callers / --callees require the call-graph index — run --full-index first
tree-sitter-analyzer --full-index                 # build call-graph index (run once)
tree-sitter-analyzer --callers <symbol>           # who-calls
tree-sitter-analyzer --codegraph-impact <fn>      # blast radius + risk
tree-sitter-analyzer --affected <file...>         # tests transitively affected
tree-sitter-analyzer --dead-code                  # transitive unreachable
tree-sitter-analyzer --check-constraints          # architectural rules
tree-sitter-analyzer --safe-to-edit <file>        # refuse if risky
tree-sitter-analyzer --uml class                  # Mermaid UML class diagram

Installing the package also registers three standalone search utilities (thin entry points over the same engine, handy in shell pipelines):

list-files <dir>          # fd-style file discovery
search-content <pattern>  # ripgrep-style content search
find-and-grep <pattern>   # two-stage fd + ripgrep

See docs/CODEMAPS/cli.md for the full surface.


How TSA compares to CodeGraph

Call-graph correctness — TSA resolves what CodeGraph mis-wires

Token cost is one axis; a code-intelligence tool's first job is a correct graph.

Head-to-head on this repo, both tools' live indexes (count every call edge whose caller language differs from the callee's — a cross-language mis-wire by construction; reproducible):

tool

cross-language mis-wires

total call edges

rate

CodeGraph

745

38,103

1.96 %

Tree-sitter Analyzer

6

114,160

0.005 %

~390× cleaner on cross-language correctness, while resolving 3× more call edges. CodeGraph's mis-wires span 19+ language pairs (python→swift 408, python→typescript 195, python→ruby 81, …); TSA's 6 are all java→python/php from single-word Java method names.

Don't trust this table — run it on your own repo (no CodeGraph install needed):

uvx --from tree-sitter-analyzer miswire-audit .

It indexes your code and prints how many call edges a name-only resolver (the design most indexes use) would mis-wire across a language boundary vs how many TSA does — with the offending edges listed (Python sorted() → Swift func at file:line). Add --card for a shareable scorecard.

Real runs: on HuggingFace tokenizers (Rust+Python+JS+TS) a name-only resolver would mis-wire 1,259 call edges (incl. a JS tokenize() → Rust def) — TSA: 0. On a single-language repo (gin, Go) both are 0 — no false positives. More examples →

Concretely:

call (Python _resolve_entry_points / build_response)

CodeGraph

TSA

sorted() (Python builtin)

❌ callee = tests/golden/corpus_swift.swift — a Swift func sorted (wired as a callee of 299 Python functions repo-wide)

builtin — no cross-language edge

fts_search() / fts_search_ranked()

❌ bound to the test mock (FallbackCache) instead of the real method

✅ resolves to the source method (_ast_cache_query.py / ast_cache.py)

TSA's per-language resolver gates every binding by language family across 13 languages (Python · Java · Go · JS · TS · C · C++ · Rust · C# · Kotlin · Ruby · PHP · Swift) and demotes test-only definitions for non-test callers, across all of its resolution paths. Telling an agent that a Python function calls a Swift method, or that a production call targets a test mock, is wrong structural data — and it is the dominant failure mode of a name-only index.

Correct and complete — 96.3% of call edges classified

A correct graph that leaves most edges unknown is still half a graph. TSA's resolution cascade now classifies 96.3% of call edges (up from 83.9%), with zero cross-language or test-shadow mis-wires — every gain is gated on the project owning no compatible-language symbol of that name, so shadowing is always preserved:

resolver tier

what it resolves

source

binding cascade

local / self / import / unique-method / single-global

RFC-0002

stdlib method names (write_text, strip, items)

str / Path / dict / re / argparse methods → stdlib

RFC-0004

external library methods (raises, given, MagicMock)

pytest / hypothesis / mock → external

RFC-0005

The remaining ~4% unknown is dominated by genuinely-unresolvable dynamic dispatch (BaseTool.execute()), constructors, and ambiguous same-name project methods — the false-positive floor of static analysis, left honest rather than guessed.

Now multi-language. Cross-language-safe resolution is no longer Python-only. A per-language resolver registry (RFC-0010) gives each language its own classification cascade with conservative stdlib/external tiers, gated by language family so a binding does not cross into an incompatible language. Active classified call graph (call-edge extraction + per-language resolver), 13 languages: Python · Java · Go · JavaScript · TypeScript · C · C++ · Rust · C# · Kotlin · Ruby · PHP · Swift. Each has its own conservative stdlib/external tiers and is adversarially verified to never bind across a language boundary. Swift is notable: CodeGraph's flagship mis-wire binds 299 Python sorted() callers to a Swift func sorted — TSA resolves Swift correctly and refuses that exact cross-language bind (verified both directions). Measured on the active set: 6 cross-language edges (6 of ~57,000 resolved edges, all generic 1-word Java method names) — ~390× cleaner than CodeGraph on cross-language correctness, which wires 299 Python sorted() callers to a single Swift func sorted (TSA binds 0 of 298). Full reproducible audit: benchmarks/codegraph_compare/REPORT-v1.21.0.md. Adding a language is one new resolver file (RFC-0010) plus a small call-extraction wiring.

Symbol kinds, too. TSA classifies class members as kind=method (20,348 method rows on this repo) — search action=symbol kind=method returns them; CodeGraph parity, not a stub. The index status payload breaks symbols down by kind and language and edges by kind (edges_by_kind — a breakdown CodeGraph does not surface).

Where TSA leads

  • Index build speed. Removing a redundant post-index edge-refresh pass cut a cold django index (~2 950 files) from 181 s → 97 s (−46 %); the win grows with repo size. Re-index of unchanged files is a content-hash lookup.

  • Strict CLI superset. Every MCP tool has a CLI equivalent (CodeGraph's CLI is thinner); behavioural defaults (ranking, limits, truncation) are kept in lock-step between the two surfaces. Output format is the one intentional divergence — MCP defaults to TOON (token-efficient for agents), the CLI to JSON (human/jq-friendly).

  • One-call expressiveness. A jQuery-style chain DSL — search('X').callees(depth=2).explore(include_code=true).answer(compact=true) — returns an entire flow's subgraph + source in a single call, with JS-style true/false so agents can write it naturally.

  • Output is structured + token-aware. TOON default for MCP (~half the size of JSON on bulk/tabular output; decision-tool wiring corrected in RFC-0018), per-call truncation hints, consistent test-file de-prioritisation across every ranking path.

  • Breadth. Health scoring, safe-to-edit / change-impact gating, 13 curated Skills, and broad language coverage.

On token cost — and a benchmark we corrected

Correction (2026-06). An earlier version of this section claimed TSA beat CodeGraph on agent token cost (a "−11 % median" table). That benchmark had a harness bug: the TSA arm's MCP server was started without an explicit project root and analysed tree-sitter-analyzer's own source instead of the target repo, so its numbers were meaningless. The bug is fixed (the harness now passes --project-root), the inflated claim is withdrawn, and the honest picture is below.

Token cost was the one axis where CodeGraph led. RFC-0006 progressive disclosure closes most of the gap at the source: nav context now returns a lean default — entry points + a compact related_symbols list + code blocks — and moves the flat node/edge graph behind an opt-in include_graph=true. Measured on this repo (4 representative queries, TOON):

context payload

chars

TSA default, before RFC-0006

~13,900

TSA default, after (lean)

~6,600 (−53%)

TSA include_graph=true (full, opt-in)

~13,900

CodeGraph baseline

~4,400

The dominant context call went from ~2.9× CodeGraph's payload to ~1.5×.

For context, the per-task $ cost measured before RFC-0006 (corrected harness — Claude Sonnet, gin + django, MCP arms, no errors):

arm

median cost (pre-RFC-0006)

tool calls

file reads

CodeGraph MCP

~$0.27

7

2

Tree-sitter Analyzer MCP

~$0.44

7

1

no-MCP (grep/read)

~$0.34

14

7

A full per-task $ re-benchmark is the next measurement (harness command below). We report the payload proxy straight rather than restate the old table as if RFC-0006 hadn't shipped.

Reactive push + edge-kind breakdown — two things CodeGraph can't do

CodeGraph (and most one-shot indexers) only answer on poll: you ask, it replies with a snapshot, and you re-ask to learn whether anything changed. TSA exposes two capabilities that close that loop:

  • Reactive push / subscription (RFC-0001, implemented). search action=subscribe registers a Hyphae selector and returns a tsa://hyphae/{selector} MCP resource URI. When the watched code changes, the server emits a resource-updated notification — the agent re-reads the resource instead of polling. search action=unsubscribe cancels it. CodeGraph has no push or subscription channel.

  • edges_by_kind in index action=status. Status returns a per-edge-kind count (calls / extends / implements / imports …), not just a single total_edges — so an agent can read the graph's shape (how call-heavy vs inheritance-heavy a repo is) before drilling in. CodeGraph surfaces only a flat total.

Reproduce the correctness fixes on any repo both tools have indexed:

# CodeGraph: emits the cross-language / test-shadow callee
#   (e.g. `sorted` → corpus_swift.swift, `fts_search` → test mock)
# TSA after the resolver fix: language-correct, source-preferring
tree-sitter-analyzer --callees _resolve_entry_points --format json

Reproduce the cost numbers: uv run python benchmarks/codegraph_compare/run.py phase full-warm --repos gin,django. Raw envelopes + the harness fix live in that directory.


How It Works

Source code → tree-sitter parse → SQLite + FTS5 index (.ast-cache/index.db)
                                         ↓
        nav (navigate) / structure (explore) / nav (callers) / ...
                                         ↓
                            TOON-encoded envelope
                            (compact for tabular output;
                             verdict + agent_summary + data)
                                         ↓
                              MCP client / CLI consumer

The index is built lazily on first query, refreshed on file change via a content-hash diff (index action=sync). All 8 tools read from the same .ast-cache/, so a query and its follow-up share work.


Supported Agents

claude mcp add tree-sitter-analyzer \
  --env TREE_SITTER_PROJECT_ROOT="$PWD" \
  -- uvx --from "tree-sitter-analyzer[mcp]" tree-sitter-analyzer-mcp

Verify: claude mcp list. The 13 tsa-* skills auto-discover from .claude/skills/.

PyPI / uvx users — install the bundled skills once with:

tree-sitter-analyzer --install-skills              # into ./.claude/skills/ (this project)
tree-sitter-analyzer --install-skills-global       # into ~/.claude/skills/ (all projects)

Git-clone users already have them — no action needed.

Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\, Linux: ~/.config/Claude/):

{
  "mcpServers": {
    "tree-sitter-analyzer": {
      "command": "uvx",
      "args": ["--from", "tree-sitter-analyzer[mcp]", "tree-sitter-analyzer-mcp"],
      "env": { "TREE_SITTER_PROJECT_ROOT": "/absolute/path/to/your/project" }
    }
  }
}

Create .vscode/mcp.json (note: servers, not mcpServers):

{
  "servers": {
    "tree-sitter-analyzer": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "tree-sitter-analyzer[mcp]", "tree-sitter-analyzer-mcp"],
      "env": { "TREE_SITTER_PROJECT_ROOT": "${workspaceFolder}" }
    }
  }
}

All read the same mcpServers schema as Claude Desktop. Cursor: Settings → MCP. Cline: MCP panel → Edit settings. Continue: ~/.continue/config.json under experimental.modelContextProtocolServers. Roo Code: MCP panel → Edit MCP Settings.

The repo ships a Dockerfile that builds the MCP server (stdio transport) from source, so the image always matches the committed code.

# Build once
docker build -t tree-sitter-analyzer-mcp .

# Run against the current repo (server speaks MCP over stdio; -i keeps stdin open)
docker run --rm -i --user "$(id -u):$(id -g)" \
  -v "$PWD:/work" -w /work tree-sitter-analyzer-mcp

--user "$(id -u):$(id -g)" runs as your host UID/GID, so the .ast-cache/, decision journal, and any edit writes under the bind-mounted repo are owned by you, not root.

MCP client config (the project root inside the container is the mount point /work):

{
  "mcpServers": {
    "tree-sitter-analyzer": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "--user", "1000:1000",
        "-v", "/absolute/path/to/your/project:/work",
        "-w", "/work",
        "-e", "TREE_SITTER_PROJECT_ROOT=/work",
        "tree-sitter-analyzer-mcp"
      ]
    }
  }
}

⚠️ TREE_SITTER_PROJECT_ROOT must be absolute. The server enforces a security boundary against escapes via SecurityValidator.


Supported Languages

22 language plugins; 13 fully wired into the indexer (full symbol + call graph) + 2 symbol-indexed (call-graph wiring pending) + 5 (data/markup) reachable via the single-file CLI path + 2 scaffold (plugin exists, indexer wiring pending). bash and scala graduated in v1.22.0; the 2026-05-24 patch unblocked Swift / Kotlin / Ruby / PHP / C# that had been silently skipped for months.

Tier

Languages

Full index + symbol + call graph

Python · Java · JavaScript · TypeScript · Go · Rust · C · C++ · C# · Swift · Kotlin · Ruby · PHP

Full index + symbols (call-graph wiring pending)

Bash · Scala

Single-file analysis (CLI)

HTML · CSS · Markdown · SQL · YAML

Scaffold (plugin exists, indexer wiring pending)

JSON · Lua

CodeGraph supports a similar set. Dart, Vue, Svelte, Lua are not yet shipped — aspirational backlog, no committed date.


Configuration

Mostly nothing. The defaults are designed so you can hook it into your agent and forget:

  • Output format: TOON. Override per-call with output_format: "json".

  • Project root: TREE_SITTER_PROJECT_ROOT (env var, MCP) or --project-root (CLI).

  • Cache location: <project>/.ast-cache/. Safe to delete — auto-rebuilds.

  • Optional: TREE_SITTER_OUTPUT_PATH for large-output write target.


Quality & Testing

Metric

Value

Tests passed

Comprehensive test suite ✅

Coverage

Coverage

Type safety

100 % mypy

Platforms

macOS · Linux · Windows

Pre-commit gates

ruff · bandit · mypy · pyupgrade · detect-secrets · tsa-codemap-sync

uv run pytest -q                                # full suite
uv run pytest -q --maxfail=1 -m "not slow and not full_language and not integration"  # fast local loop
PYTEST_XDIST_AUTO_NUM_WORKERS=1 uv run pytest -q --maxfail=1 -m "not slow and not full_language and not integration"  # one-worker mode for lower CPU load
PYTEST_XDIST_AUTO_NUM_WORKERS=2 uv run pytest -q --maxfail=1 -m "not slow and not full_language and not integration"  # two-worker balanced mode
uv run pytest --lf --maxfail=1                  # rerun only failed tests from last run
uv run python check_quality.py --new-code-only  # quality gate

Troubleshooting

Symptom

Fix

unsupported language on .swift / .kt / .rb / .php / .cs

Update to ≥ 1.12.x — the 5-language gap was patched in commit 50e99a8f. Grammar modules for extras-gated languages are not bundled in the base install; run pip install "tree-sitter-analyzer[swift]" (or kotlin, ruby, php, csharp) to add them.

MCP server doesn't appear in client

TREE_SITTER_PROJECT_ROOT must be an absolute path (e.g. $(pwd) or /home/user/project); a relative path causes the server to resolve against the wrong directory. Restart the client after editing. Run tree-sitter-analyzer --doctor to verify.

database is locked

Stop any other process holding .ast-cache/index.db; if persistent, rm -rf .ast-cache && tree-sitter-analyzer --full-index.

Slow first call

First call builds the index. Subsequent calls are sub-second. Run --full-index upfront to amortise.

Agent picks the wrong tool

Use a tsa-* skill (/tsa-graph, /tsa-find, ...) — each skill restricts the visible tool set to one workflow.


Development

git clone https://github.com/aimasteracc/tree-sitter-analyzer.git
cd tree-sitter-analyzer
uv sync --extra all --extra mcp
uv run pytest -q

See docs/CONTRIBUTING.md for the development guide.


Contributing & License

  • ⭐ A GitHub star helps surface this tool to other AI-agent users.

  • 💖 Sponsor — supports continued MCP / Skills development.

  • Lead sponsor: @o93.

  • MIT licensed — see LICENSE.

  • Release history: CHANGELOG.md.

Available Tools

9 tools
editA

Code-intelligence (codegraph-compatible) safety and change-management facade. Covers codegraph_pr_review (PR analysis via codegraph), safe-to-edit gates, blast-radius guards, change impact scanning, refactoring suggestions, constraint checks, semantic classification, and AST diff in one tool. Pick a capability via action:

  • action=safe — pre-edit safety gate: is this file safe to edit right now? Returns SAFE/UNSAFE verdict. Params: file_path, edit_type, output_format.

  • action=guard — blast-radius guard BEFORE touching a symbol: how many callers, what test coverage, what risk level. Params: symbol* (required), modification_type* (required), file_path.

  • action=impact — post-edit dependency blast-radius scan combining git diff + dependency graph: affected files, must-run tests, risk verdict (SAFE/REVIEW/WARN). Call after every non-trivial edit. Params: mode (diff|staged|branch|pr, default: diff), scope_paths, output_format.

  • action=refactor — refactoring-opportunity analysis for a source file: extract candidates, complexity hotspots, skeleton. Params: file_path, language, max_suggestions, include_extractions, include_skeleton, output_format.

  • action=constraints — scan the project for constraint/rule violations (architecture, naming, coupling). Params: severity_min, output_format.

  • action=pr — AI review of a PR diff via codegraph: structural issues, blast-radius, test-coverage gaps (codegraph_pr_review equivalent). Params: pr_url or diff (see inner schema).

  • action=classify — semantic change classification: classify a file's diff between git refs (file_path [+ old_ref/new_ref]) or two code strings (old_source + new_source + language). With only file_path, defaults to the file/git-ref mode. Params: file_path | old_source+new_source+language, output_format.

  • action=ast_diff — structural AST diff between two snapshots/versions of a file: added/removed/changed nodes. Mode is inferred from args when omitted. Modes: diff_files (old_file + new_file), diff_strings (old_source + new_source + language), diff_git (old_ref + new_ref + file_path). Params: see inner schema. NOTE: safe/impact/classify/constraints/pr/ast_diff are read-only in practice; refactor/guard suggest changes but do not write files. readOnlyHint is False for the whole facade (mixed action set).

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYesWhich capability to invoke. One of: ast_diff, classify, constraints, guard, impact, pr, refactor, safe
scopeNoAction discriminator (e.g. point|graph).
modeNoAction sub-mode (e.g. summary|cycles).
file_pathNoTarget file path.
symbolNoSymbol/function name.
function_nameNoFunction name (alias of symbol).
queryNoSearch query/pattern.
languageNoLanguage hint (usually auto).
limitNoMax results.
output_formatNoOutput format (toon|json).
modification_typeNoRequired for action=guard: type of planned modification. One of: add_feature, behavior_change, delete, fix_bug, refactor, rename, signature_change.

TDQS

A4.5/5.0
Behavior4/5

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

The description adds value beyond annotations by explaining the mixed nature of the actions (some read-only, some non-writing). Annotations set readOnlyHint=false overall, but the description clarifies which specific actions are safe. No contradictions with annotations.

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 lengthy but well-structured, with action definitions clearly separated. It front-loads the overall purpose and uses bullet-style formatting. For the complexity of 8 actions and 11 parameters, it is appropriately sized, though slightly verbose.

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 complex multi-action facade with no output schema, the description covers each action's purpose, parameters, and behavior comprehensively. It notes data formats and override behaviors, making it complete for the tool's scope.

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?

The description significantly enriches the input schema by detailing required parameters per action (e.g., 'symbol* (required)' for guard) and adds context on how parameters like 'mode' or 'output_format' are used. Schema coverage is 100%, but the description provides the 'why' behind parameter usage.

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 defines the tool as a 'safety and change-management facade' for code intelligence, listing 8 distinct actions with specific verbs and resources (e.g., 'action=safe — pre-edit safety gate'). It distinguishes itself from sibling tools like 'health' or 'index' by being a composite facade covering multiple capabilities.

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 provides explicit guidance for each action, stating when to use them (e.g., 'Call after every non-trivial edit' for impact) and notes that some actions are read-only while others suggest changes. However, it does not explicitly state when not to use this tool in favor of alternatives.

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

healthA
Read-onlyIdempotent

Code-intelligence (codegraph-compatible) health and analysis facade. Covers codegraph_complexity_heatmap, codegraph_import_graph, codegraph_dependency_matrix, codegraph_dead_code, codegraph_overview, and project/file health metrics in one tool. Pick a capability via action:

  • action=project — overall project code-quality grade + per-file grade breakdown. Params: min_grade, max_files.

  • action=file — per-file health: complexity, duplication, style. Params: file_path (required), language.

  • action=scale — lines-of-code / complexity / size metrics. Params: file_path, file_paths, language, metrics_only, include_complexity, include_details, include_guidance.

  • action=patterns — anti-pattern detection by category and severity. Params: file_path (required), categories, severity_threshold.

  • action=heatmap — complexity heatmap ranked by file or function (codegraph_complexity_heatmap equivalent). Params: mode, file_path, function_name, language, directory, max_files.

  • action=imports — module import dependency graph (who imports whom, codegraph_import_graph equivalent). Params: mode, file_path, max_depth.

  • action=matrix — coupling matrix and top-k coupling ranks (codegraph_dependency_matrix equivalent). Params: mode, file_path, top_k, threshold.

  • action=dead — unreferenced functions / unused imports / unused variables (codegraph_dead_code equivalent). Params: mode, include_test_files, max_dead, max_imports, max_variables.

  • action=routes — HTTP route discovery across framework conventions. Params: mode, url_pattern, file_path, framework.

  • action=overview — entry-points / hub files / dead-code summary (codegraph_overview equivalent). Params: max_entry_points, max_hubs, max_dead, max_coupled_files.

  • action=deps — dependency analysis (R5 multi-mode). Params: mode (summary|cycles|blast|file_deps), file_path. mode=summary: project-level dependency overview. mode=cycles: detect circular dependencies. mode=blast: blast-radius for a given file_path. mode=file_deps: file-level dependency details.

  • action=test_gap — untested symbol discovery ranked by cyclomatic complexity. Params: mode (summary|gaps|file), file_path, language, max_files, max_gaps, include_covered, output_format. For UML diagrams, call/dependency graph visualizations, and similarity analysis, use the viz facade instead.

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYesWhich capability to invoke. One of: dead, deps, file, heatmap, imports, matrix, overview, patterns, project, routes, scale, test_gap
scopeNoAction discriminator (e.g. point|graph).
modeNoAction sub-mode (e.g. summary|cycles).
file_pathNoTarget file path.
symbolNoSymbol/function name.
function_nameNoFunction name (alias of symbol).
queryNoSearch query/pattern.
languageNoLanguage hint (usually auto).
limitNoMax results.
output_formatNoOutput format (toon|json).

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already indicate read-only, non-destructive, idempotent, and not open-world. The description adds context about the tool being 'codegraph-compatible' and details the behavior of each action (e.g., 'unreferenced functions / unused imports' for dead action). No contradictions with annotations.

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 long but well-structured with bullet points for each action and sub-options. It front-loads the overall purpose and then systematically lists actions. Every sentence adds value; no wasted words. Could be slightly more concise but appropriate given the complexity.

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?

Given the tool's complexity (12 actions, 10 parameters, many sub-modes), the description is comprehensive. It covers all actions and their parameters, mentions alternatives (viz), and describes behavioral outcomes. Missing explicit return format descriptions, but overall complete.

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

Parameters3/5

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

Schema has 100% description coverage, but descriptions are terse (e.g., 'Target file path'). The tool description extensively lists parameters per action, often with specifics like 'min_grade, max_files' that are not in the schema's explicit properties (since schema uses additionalProperties true). This adds meaning beyond the schema but also introduces inconsistency since those parameters are undocumented in the schema itself.

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 it's a 'Code-intelligence (codegraph-compatible) health and analysis facade' and lists 12 distinct actions, each with a specific verb (e.g., 'dead', 'deps', 'file'). It explicitly distinguishes from the sibling tool 'viz' by stating 'For UML diagrams... use the viz facade instead.'

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 provides clear context: 'Pick a capability via action' and details each action with parameters. It explicitly says when not to use this tool ('For UML diagrams... use the viz facade instead'). However, it does not guide on when to use this tool over other siblings like 'project' or 'search', though the scope is well-defined.

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

indexA

Code-intelligence (codegraph-compatible) index lifecycle hub. Covers codegraph_status, codegraph_full_index, codegraph_autoindex, codegraph_incremental_sync, and AST cache query 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, staleness, and error indicators. Params: (none).

  • 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.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYesWhich capability to invoke. One of: auto, build, cache, full, status, sync
scopeNoAction discriminator (e.g. point|graph).
modeNoAction sub-mode (e.g. summary|cycles).
file_pathNoTarget file path.
symbolNoSymbol/function name.
function_nameNoFunction name (alias of symbol).
queryNoSearch query/pattern.
languageNoLanguage hint (usually auto).
limitNoMax results.
output_formatNoOutput format (toon|json).

TDQS

A4.6/5.0
Behavior5/5

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

Annotations set readOnlyHint=false and destructiveHint=false, but the description transparently details which actions are read-only (status, cache in certain modes) and which write to disk. It warns about potential mutating modes in the cache action and notes performance implications (e.g., 'Slow' for build). No contradiction with 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 well-organized with bullet points and clear sections. It front-loads the purpose, then lists actions with their behavior and parameters. Every sentence adds value without redundancy.

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 having no output schema, the description explains what each action returns (e.g., 'Returns node/edge counts, staleness, and error indicators' for status). It covers all 10 parameters and 6 actions comprehensively, making the tool self-contained.

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?

Schema coverage is 100% with parameter descriptions, but the description adds significant value by specifying which parameters apply to each action (e.g., 'Params: (none)' for status, detailed params for cache). This goes beyond the schema's generic descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool is an 'index lifecycle hub' covering multiple codegraph actions. It lists specific capabilities via the `action` parameter. However, it does not explicitly differentiate this tool from siblings like 'search' or 'nav', which might handle some overlap.

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 provides guidance on when to use each action (e.g., 'use when index is absent or corrupt' for build, 'run after editing files' for sync). It distinguishes read-only vs write actions. Missing explicit when-not-to-use or alternatives, but context is clear.

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

projectA

Code-intelligence (codegraph-compatible) project-intelligence hub. Covers codegraph_metrics (graph-level stats), project overview, file enumeration, smart task-focused context, parser readiness, agent skills/workflow, decision journal, and doc sync in one tool. Pick a capability via action:

PROJECT INFO (read-only):

  • action=overview — high-level summary of languages, entry points, and architecture. Best first call on an unfamiliar repo. Params: format.

  • action=files — enumerate source files with filtering. Params: path, extensions, limit, format.

  • action=smart — one-shot orientation for a single file: file_health grade, exported symbols (the file's public API), upstream/downstream dependencies, associated test files, and edit-risk in one envelope (replaces Read + file_health + dependency_analysis + safe_to_edit). Params: file_path.

  • action=parser — check tree-sitter parser readiness for the project languages. Params: format.

  • action=tools — verify availability of CLI tools (ripgrep, fd, etc.). Params: (none).

  • action=metrics — codegraph graph-level statistics (node/edge counts, top hubs, codegraph_metrics equivalent). Params: format.

  • action=skills — enumerate available agent skills for this project. Params: format.

  • action=workflow — recommended agent workflow for the current task type. Params: task_type, format.

DECISION + DOC (may write):

  • action=journal — persistent architectural decision journal. Params: mode (record/get/search/supersede), title, rationale, verdict, query, verdict_filter, id, new_id, scope_paths, alternatives, related_symbols, tags, path_scope, limit.

  • action=doc_sync — sync documentation to current code state. Params: path, dry_run.

For index lifecycle (status/build/full/auto/sync/cache), use the index facade instead.

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYesWhich capability to invoke. One of: doc_sync, files, journal, metrics, overview, parser, skills, smart, tools, workflow
scopeNoAction discriminator (e.g. point|graph).
modeNoAction sub-mode (e.g. summary|cycles).
file_pathNoTarget file path.
symbolNoSymbol/function name.
function_nameNoFunction name (alias of symbol).
queryNoSearch query/pattern.
languageNoLanguage hint (usually auto).
limitNoMax results.
output_formatNoOutput format (toon|json).

TDQS

A4.7/5.0
Behavior5/5

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

The description discloses behavioral traits beyond annotations: it separates actions into read-only and may-write categories, indicates that overview is ideal for first use, and advises using a different tool for index lifecycle. Annotations (readOnlyHint=false) are consistent with the mixed read/write nature.

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 well-structured with a clear overview followed by grouped actions in bullet points. It is front-loaded with the purpose and every sentence adds value. No unnecessary text.

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 10 parameters and no output schema, the description covers all actions, their parameters, usage hints, and cross-tool guidance. It is fully self-contained for an agent to understand when and how to invoke the 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?

With 100% schema coverage, the description adds value by grouping parameters per action and explaining their role in context (e.g., 'Params: path, extensions, limit, format' for files). This provides semantic context beyond the schema's property 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 clearly defines the tool as a 'project-intelligence hub' with specific capabilities. It enumerates all actions and distinguishes from the sibling tool 'index' for lifecycle operations. The purpose is specific and not a tautology.

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 provides explicit guidance for when to use each action, e.g., 'Best first call on an unfamiliar repo' for overview, and recommends the 'index' facade for index lifecycle. However, it does not compare against all siblings like 'edit' or 'nav'.

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

set_project_pathA

SMART Workflow 'Set' step (FIRST): Set the project root path for security boundaries. Call this before any other tool to ensure correct file resolution and security validation.

ParametersJSON Schema
NameRequiredDescriptionDefault
project_pathYesAbsolute path to the project root

TDQS

A4/5.0
Behavior3/5

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

No annotations; description adds context about security boundaries and being the first step, but does not detail side effects, idempotency, or error handling.

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?

Two concise sentences front-loading purpose and usage. No unnecessary words.

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?

Adequate for a simple setter tool: explains why it's needed (security, file resolution) and gives usage instruction. Lacks return value info but acceptable.

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

Parameters3/5

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

Schema coverage is 100% with 'Absolute path to the project root'. Description repeats this without adding new constraints, format, or examples.

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?

Description clearly states 'Set the project root path for security boundaries' and identifies it as the first step, distinguishing it from sibling tools which are likely not initialization tools.

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?

Explicitly says 'Call this before any other tool', providing clear when-to-use guidance, but lacks when-not-to-use or alternative tool mentions.

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

structureA
Read-onlyIdempotent

Code-intelligence (codegraph-compatible) structural analysis facade. Covers codegraph_explore (multi-symbol source), codegraph_class_hierarchy, codegraph_class_inspect, codegraph_sitemap, codegraph_ast_path, and code-outline/complexity in one tool. Pick a capability via action:

  • action=outline — AST-based symbol outline for a file or directory. Params: file_path, language, depth.

  • action=analyze — complexity + structure analysis (cyclomatic, nesting, cohesion). Params: file_path, language.

  • action=signatures — LIGHTWEIGHT method-directory (~25 %% of full tokens). Lists every method as 'name →returnType(Np) startLine-endLine' grouped by class. Use FIRST for large files (>500 lines) to pick methods by name, then action=read to fetch bodies. Supports Python, Java, and other languages. Params: file_path[, language] (language auto-detected from file extension when omitted).

  • action=ast_path — AST path from a specific node up to the file root (navigate the parse tree, codegraph_ast_path equivalent). Params: file_path, line, column.

  • action=sitemap — high-level symbol sitemap of a directory or the whole project (what is defined where, codegraph_sitemap equivalent). Params: mode (full|api|module|flat), directory (relative path, optional), language, max_files. NOTE: takes a directory, not file_path — omit directory for the whole project.

  • action=class_tree — class inheritance/subclass hierarchy (codegraph_class_hierarchy equivalent). Params: class_name, mode (subclasses|superclasses|supers|tree|impact|all|summary). 'supers' is an alias for 'superclasses'.

  • action=class_detail — detailed class inspection: fields, methods, visibility, inherited members (codegraph_class_inspect equivalent). Params: class_name (or query as alias), language.

  • action=explore — multi-symbol source explorer: show source of several related symbols grouped in one capped response (codegraph_explore equivalent). Params: symbols (list) or symbol/query (string), maxSymbols, maxFiles.

  • action=read — extract a file section (single) or multiple sections (batch). Single: file_path + start_line [+ end_line + column bounds]. Batch: requests=[{file_path, sections:[{start_line, end_line}]}].

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYesWhich capability to invoke. One of: analyze, ast_path, class_detail, class_tree, explore, outline, read, signatures, sitemap
scopeNoAction discriminator (e.g. point|graph).
modeNoAction sub-mode (e.g. summary|cycles).
file_pathNoTarget file path.
symbolNoSymbol/function name.
function_nameNoFunction name (alias of symbol).
queryNoSearch query/pattern.
languageNoLanguage hint (usually auto).
limitNoMax results.
output_formatNoOutput format (toon|json).
class_nameNoClass name for class_tree and class_detail actions.

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already indicate readOnlyHint=true and idempotentHint=true. The description adds rich behavioral context: notes about signatures being lightweight, sitemap taking directory not file_path, and language auto-detection. No contradictions.

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 bullet points and clear action listings. It is long but each sentence adds value. Slight redundancy (e.g., repeating 'codegraph_* equivalent') but overall efficient for the complexity.

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 11 parameters, 9 actions, no output schema, and no annotations beyond safety hints, the description is remarkably complete. It covers all actions, parameter details, and usage tips, leaving no significant gaps.

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?

Schema coverage is 100%, but description adds significant meaning beyond parameter names. For each action, it explains how parameters are used (e.g., for signatures: 'Params: file_path[, language] (language auto-detected from file extension when omitted)'). Also clarifies that directory is optional for sitemap.

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 is a multi-action facade for code intelligence. It enumerates each action (outline, analyze, signatures, etc.) with specific verbs and resources, distinguishing it from sibling tools like edit or search.

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 provides explicit guidance for when to use each action (e.g., 'Use FIRST for large files (>500 lines) to pick methods by name, then action=read'). It does not cover when to avoid this tool in favor of siblings, but the guidance is clear for the tool's own actions.

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

vizA
Read-onlyIdempotent

Code-intelligence (codegraph-compatible) visualization and similarity facade. Covers codegraph_uml (UML diagrams), codegraph_visualize (call/dependency graph visualizations), and codegraph_similarity (duplicate code detection) in one tool. Pick a capability via action:

  • action=uml — UML class or sequence diagrams (codegraph_uml equivalent). Params: diagram, source, target, max_edges, max_depth, max_paths, package_depth, include_external_bases, file_path, class_name, include_tests.

  • action=graph — call/dependency graph visualizations (codegraph_visualize equivalent). Params: mode, file_path, function, depth, max_edges, direction.

  • action=similarity — duplicate / near-duplicate code detection (codegraph_similarity equivalent). Default response is a summary map (files, line ranges, scores — no bodies). Params: mode, min_lines, min_group_size, max_groups, use_cache, include_bodies (set include_bodies=true to add code snippets; omit for the compact default).

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYesWhich capability to invoke. One of: graph, similarity, uml
scopeNoAction discriminator (e.g. point|graph).
modeNoAction sub-mode (e.g. summary|cycles).
file_pathNoTarget file path.
symbolNoSymbol/function name.
function_nameNoFunction name (alias of symbol).
queryNoSearch query/pattern.
languageNoLanguage hint (usually auto).
limitNoMax results.
output_formatNoOutput format (toon|json).
max_groupsNoaction=similarity: max clone groups to return (default: 20).
min_linesNoaction=similarity: min function body lines to consider (default: 5).
min_group_sizeNoaction=similarity: min clone group size to report (default: 2).

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already indicate readOnlyHint=true and destructiveHint=false, so the description adds value by explaining default behaviors (e.g., similarity returns a summary map without bodies by default, option to include bodies). It also lists per-action parameters, providing additional context beyond what annotations offer.

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 clear action breakdowns and parameter lists. It is front-loaded with the overall purpose and then details each action. Every sentence adds value, though it could be slightly more concise without losing clarity.

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

Completeness3/5

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

Given the tool's complexity (3 sub-tools, 13 parameters), the description covers key actions and their parameters but has gaps. For graph and UML actions, the return format is not described. The 'mode' and 'scope' parameters are not explained in the description, only in the schema. This leaves some ambiguity for the agent.

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

Parameters3/5

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

Schema coverage is 100%, so baseline is 3. The description adds semantic grouping by action and mentions defaults for similarity params (min_lines, min_group_size, max_groups). However, many parameters (scope, mode, file_path, etc.) are only described in the schema, not in the description. The description adds some but not full compensation.

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 is a 'visualization and similarity facade' covering UML diagrams, call/dependency graphs, and duplicate code detection. It distinguishes these three capabilities and implicitly differentiates from sibling tools like search or edit by specifying the visualization/similarity domain.

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

Usage Guidelines3/5

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

The description lists the three actions and their parameters, implying when each should be used (e.g., 'action=uml for UML diagrams'). However, it does not provide explicit guidance on when not to use this tool versus alternatives (e.g., using search for code queries). Usage is implied but not contrasted with sibling tools.

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

TDQS

A4.2/5.0
Disambiguation4/5

Each tool has a distinct domain (edit safety, health metrics, index lifecycle, navigation, project intelligence, search, path setup, structural analysis, visualization), making them reasonably distinguishable. Some names like 'project' and 'health' could be confused at a high level, but detailed descriptions clarify their roles.

Naming Consistency3/5

Tool names are a mix of single words (edit, health, index, project, search, structure), abbreviations (nav, viz), and a verb phrase with underscores (set_project_path). This inconsistency in style and use of abbreviations reduces coherence, though the names remain readable.

Tool Count5/5

With 9 tools covering a broad range of code intelligence capabilities (editing, health, indexing, navigation, search, etc.), the count is well within the ideal 3-15 range. Each tool is a necessary facade for a distinct aspect of analysis.

Completeness5/5

The tool set covers the full lifecycle of code intelligence: setup (set_project_path), safety (edit), metrics (health), indexing (index), navigation (nav), search, structure, visualization, and project overview. There are no obvious gaps for the stated purpose of a tree-sitter analyzer.

Maintenance

ActivityMaintained
ResponsivenessResponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Token-efficient code intelligence MCP server that indexes codebases with tree-sitter AST parsing and provides 150 tools for AI agents, using 61-95% fewer tokens than traditional grep/Read workflows.
    380
    4
    Business Source 1.1
  • A
    license
    Not graded
    quality
    A
    maintenance
    MCP server for local-first code intelligence, providing structural code graph, semantic search, and impact analysis to AI agents.
    2
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Ultra-lightweight, local-first MCP server for AI-powered code intelligence, providing AST-based analysis and 20+ tools while ensuring zero data leakage.
    544
    10
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Give your AI coding agents superpowers — a local MCP server for fast, token-efficient code navigation, search & analysis.

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/aimasteracc/tree-sitter-analyzer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server