Skip to main content
Glama
aimasteracc

tree-sitter-analyzer

by aimasteracc

project

Analyze code repositories: get overviews, file lists, metrics, smart file context, record decisions, and sync docs via one action-based hub.

Instructions

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.

  • action=card — the project card (RFC-0027 §L7): purpose from the README, top code languages, entry points, key config files, and per-module descriptions of the top-level structure. Persistent — built once into .tree-sitter-cache/project-index.json and recalled instantly. Best first call on an unfamiliar repo when you want the what, not the file list. Params: force_refresh, include_notes, output_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.

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: card, doc_sync, files, journal, metrics, overview, parser, skills, smart, tools, workflow
symbolNoSymbol/function name.
languageNoLanguage hint (usually auto).
file_pathNoTarget file path.
function_nameNoFunction name (alias of symbol).
output_formatNoOutput format: JSON.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.30.0
    • changedInput schema / properties / action / description
      Previous value: -"Which capability to invoke. One of: doc_sync, files, journal, metrics, overview, parser, skills, smart, tools, workflow"New value: +"Which capability to invoke. One of: card, doc_sync, files, journal, metrics, overview, parser, skills, smart, tools, workflow"
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "doc_sync",
      -  "files",
      -  "journal",
      -  "metrics",
      -  "overview",
      -  "parser",
      -  "skills",
      -  "smart",
      -  "tools",
      -  "workflow"
      -]New value: +[
      +  "card",
      +  "doc_sync",
      +  "files",
      +  "journal",
      +  "metrics",
      +  "overview",
      +  "parser",
      +  "skills",
      +  "smart",
      +  "tools",
      +  "workflow"
      +]
    • 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. First observedv1.23.0

TDQS

A4/5.0
Behavior4/5

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

The annotations (readOnlyHint=false, destructiveHint=false) are consistent with the description, which usefully splits actions into '(read-only)' and 'DECISION + DOC (may write)', naming journal and doc_sync as the writers. This adds real value beyond the blanket annotation, though it does not state reversibility or auth needs for the write actions.

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?

It is long, but the length is earned by an 11-action multiplexer; the lead sentence front-loads the purpose and then groups actions by category with short, scannable lines. No filler sentences.

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?

With no output schema and 10 params across 11 actions, the description carries the burden well: every action is named with its parameters and several are annotated with intent ('Persistent — built once into .tree-sitter-cache/project-index.json'). Return-value detail is understandably omitted for each action but would help for the write actions.

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 coverage is 100% (baseline 3), but the description goes further by mapping which parameters apply to each action (e.g. journal's mode/title/rationale/scope_paths, doc_sync's dry_run), which the generic schema does not convey. Some schema params (scope, symbol, language, function_name) are never mapped to an action, leaving a small gap.

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?

It states a specific verb+resource ('code-intelligence project-intelligence hub') and enumerates the concrete capabilities behind each action, so an agent knows exactly what the tool does. It partly distinguishes itself from siblings by explicitly deferring index lifecycle to the `index` facade and noting `smart` replaces Read/file_health/dependency_analysis, but it does not differentiate from search/nav/structure/health, which it overlaps conceptually with.

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?

Each action carries explicit context ('Best first call on an unfamiliar repo' for overview and card), and the note 'For index lifecycle... use the `index` facade instead' gives a clear alternative plus exclusion. What it lacks is guidance on when to choose among sibling tools like search/nav/structure rather than this hub.

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