Skip to main content
Glama
aimasteracc

tree-sitter-analyzer

nav

Read-onlyIdempotent

Navigate code symbols, trace execution paths, find callers and callees, assess impact, and explore class lineage. Start with context for comprehensive understanding.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesWhich capability to invoke. One of: call_path, callee_tree, callees, caller_tree, callers, co_change, context, impact, lineage, navigate, resolve, test_map, trace, xref
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).
Behavior5/5

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

Annotations already mark it as read-only and idempotent. The description adds significant behavioral details beyond annotations, such as risk score computation from production edges only, test bucket always present, and nested tree capabilities.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

While well-structured with bullet points, the description is very long (over 400 words). It could be more concise by combining similar actions or reducing 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?

For a tool with 14 actions and 10 parameters, the description covers all actions, parameter combinations, usage patterns, and edge cases. No output schema, but return values are described textually. Complete given complexity.

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 provides minimal descriptions, but the tool's description adds rich detail for each action's parameters, including dependencies, defaults, and behavior differences (e.g., scope=point vs graph). This greatly exceeds the schema's coverage.

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 is a code-intelligence navigation facade covering multiple codegraph actions. It distinguishes itself from sibling tools like search and structure by positioning itself as the starting point for code understanding tasks.

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

Usage Guidelines5/5

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

Explicitly instructs to start with action=context, then use tree actions. Warns against looping search or per-symbol navigate, and tells when to use alternatives like callee_tree over looping callees.

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

Install Server

Other Tools

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