Skip to main content
Glama
aimasteracc

tree-sitter-analyzer

by aimasteracc

nav

Read-onlyIdempotent

Navigate code structure to find definitions, callers, callees, call paths, impact, and context. Start here for code tracing and call-flow questions.

Instructions

Code-intelligence (codegraph-compatible) navigation facade. Covers codegraph_navigate, codegraph_callers, codegraph_callees, codegraph_call_path, codegraph_xref, codegraph_impact, codegraph_context, codegraph_trace, and symbol lineage/resolve in one tool. START HERE for any 'how does X work' / trace / call-flow / understand-a-class question: call action=context FIRST (ONE call composes definition + callers + callees + code for a task), then action=callee_tree or caller_tree for the FULL traversal tree in ONE call. These replace many search/navigate/Read round-trips — do NOT loop search or per-symbol navigate; reach for the tree/context actions instead. Pick a capability via action:

  • action=navigate — go-to-definition / symbol navigation (codegraph_navigate equivalent). Params: symbol (required), mode (full|references|callers|callees).

  • action=call_path — BFS execution path between two functions ('how does A reach B?', codegraph_call_path equivalent). Params: source_function, target_function, source_file, target_file, direction (forward|backward|bidirectional), max_depth, max_paths.

  • action=xref — cross-reference lookup (who uses this symbol or file, codegraph_xref equivalent). Params: symbol, mode (symbol|file), file_path.

  • action=resolve — go-to-definition + find-all-references for a symbol. Params: symbol (required), mode (resolve|references), output_format.

  • action=lineage — class/function inheritance and override lineage. Params: symbol (required), output_format.

  • action=impact — blast-radius / risk scoring for a function or set of functions (codegraph_impact equivalent). Risk score computed from PRODUCTION edges only; tests bucket (test_callers_count, test_callees_count) always present. Params: mode (function_impact|blast_radius|risk_score), function_name, function_names, file_path, depth, include_tests (bool, default false — when true adds test_caller_files/test_callee_files to tests bucket).

  • action=trace — full impact trace from a symbol outward (codegraph_trace equivalent). Params: symbol (required), output_format.

  • action=context — one-call focused context for a task/symbol: composes search + definition + callers + callees in a single capped response (codegraph_context equivalent). Params: task (required — natural-language description or symbol name), max_nodes, max_code_blocks, access_mode, snapshot_id, source_generation, output_format.

  • action=callers — who calls a function (codegraph_callers equivalent). scope=point (default) → direct 1-hop callers (fast). Params: function_name/symbol (required), file_path, output_format. scope=graph → full call-graph traversal (callers mode). Params: function_name/symbol (required), file_path, depth, output_format.

  • action=callees — what a function calls (codegraph_callees equivalent). scope=point (default) → direct 1-hop callees (fast). Params: function_name/symbol (required), file_path, output_format. scope=graph → full call-graph traversal (callees mode). Params: function_name/symbol (required), file_path, depth, output_format.

  • action=callee_tree — depth-limited NESTED tree of everything a function transitively calls, in ONE call (no per-node iteration). Prefer this over looping action=callees. Params: symbol (required), file_path, max_depth (default 3, cap 10), max_nodes (default 150), output_format.

  • action=caller_tree — depth-limited NESTED tree of everything that transitively calls a function (blast radius), in ONE call. Params: symbol (required), file_path, max_depth, max_nodes, output_format.

  • action=test_map — which tests exercise a function (test-file callers, by file and test function name). Use BEFORE editing to know the test surface. Returns test_files (sorted, deduplicated), test_functions in 'file::fn' format (paste directly into pytest), edge_count (raw call edges across all resolved targets), unique_function_count (post-dedup; truncated is keyed to this), truncated flag (cap=50 unique functions). Params: symbol (required), file_path, output_format.

  • action=co_change — git-history temporal coupling: files that historically change together with a file or symbol (lift-ranked). Use BEFORE editing to find implicit coupling that the call graph cannot see (config+code, schema+handler, proto+generated stub). Params: symbol or file_path (one required), max_commits (default 500), min_shared (default 3), max_results (default 20), output_format.

  • action=pulse — 1-query complete context for one symbol: callers, callees, git heat, imports, siblings, comments. Params: file (required), symbol (required), format (skeletal|compact|verbose), token_budget, max_callers, max_callees, max_siblings, max_comments.

  • action=pulse_batch — action=pulse for multiple {file, symbol} targets in one call. Params: targets (required array of {file, symbol}), format (skeletal|compact), token_budget_per_symbol, max_symbols.

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: call_path, callee_tree, callees, caller_tree, callers, co_change, context, impact, lineage, navigate, pulse, pulse_batch, resolve, test_map, trace, xref
symbolNoSymbol/function name.
languageNoLanguage hint (usually auto).
file_pathNoTarget file path.
access_modeNoUse only a certified existing index snapshot.
snapshot_idNoOwner-issued certified index snapshot ID.
function_nameNoFunction name (alias of symbol).
output_formatNoOutput format: JSON.
source_generationNoOwner-issued certified source generation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv1.30.0
    • addedInput schema / properties / access_mode
      Added value: +{
      +  "description": "Use only a certified existing index snapshot.",
      +  "enum": [
      +    "read_existing"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / action / description
      Previous value: -"Which capability to invoke. One of: call_path, callee_tree, callees, caller_tree, callers, co_change, context, impact, lineage, navigate, resolve, test_map, trace, xref"New value: +"Which capability to invoke. One of: call_path, callee_tree, callees, caller_tree, callers, co_change, context, impact, lineage, navigate, pulse, pulse_batch, resolve, test_map, trace, xref"
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "call_path",
      -  "callee_tree",
      -  "callees",
      -  "caller_tree",
      -  "callers",
      -  "co_change",
      -  "context",
      -  "impact",
      -  "lineage",
      -  "navigate",
      -  "resolve",
      -  "test_map",
      -  "trace",
      -  "xref"
      -]New value: +[
      +  "call_path",
      +  "callee_tree",
      +  "callees",
      +  "caller_tree",
      +  "callers",
      +  "co_change",
      +  "context",
      +  "impact",
      +  "lineage",
      +  "navigate",
      +  "pulse",
      +  "pulse_batch",
      +  "resolve",
      +  "test_map",
      +  "trace",
      +  "xref"
      +]
    • 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"
      +]
    • addedInput schema / properties / snapshot_id
      Added value: +{
      +  "description": "Owner-issued certified index snapshot ID.",
      +  "type": "string"
      +}
    • addedInput schema / properties / source_generation
      Added value: +{
      +  "description": "Owner-issued certified source generation.",
      +  "type": "string"
      +}
  2. First observedv1.23.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already establish readOnly, idempotent, non-destructive semantics, so the safety profile is covered. The description goes beyond them with real behavioral detail: impact risk is 'computed from PRODUCTION edges only', the tests bucket is 'always present', test_map truncates at a 50-unique-function cap with a truncated flag, and defaults/caps are stated (max_depth default 3 cap 10, max_nodes 150). It does not describe pagination or response shape, keeping it from a 5.

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?

For a 16-action facade the length is defensible and the structure is strong: front-loaded 'START HERE' guidance followed by one scannable bullet per action. It loses a point for repetitious '(codegraph_X equivalent)' annotations on nearly every line, which add little for an agent already reading this description.

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 complexity, the description is complete: every action has a purpose, parameter list, defaults, and in several cases return-content notes (test_map's test_files/test_functions/edge_count/truncated). No output schema exists, and the description adequately covers what callers get back.

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 input schema is unusually generic for 13 parameters (e.g. mode is only 'Action sub-mode (e.g. summary|cycles)'), so the description is the de facto parameter reference. It maps parameters to specific actions, supplies real enum values the schema omits (mode full|references|callers|callees, direction forward|backward|bidirectional, scope point|graph), and specifies defaults and requiredness per action.

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 names a specific role ('code-intelligence navigation facade') and enumerates all 16 capabilities it fronts, each tied to a distinct codegraph operation. It explicitly distinguishes itself from sibling tools by stating it replaces 'many search/navigate/Read round-trips' and routes agents away from looping. An agent can identify the right capability 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 Guidelines5/5

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

It gives explicit entry-point guidance ('START HERE for any how-does-X-work question: call action=context FIRST'), prescribes action ordering ('then action=callee_tree or caller_tree'), and states exclusions ('do NOT loop search or per-symbol navigate'). Several actions carry their own when-to-use trigger, e.g. test_map and co_change both say 'Use BEFORE editing'.

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