Skip to main content
Glama
aimasteracc

tree-sitter-analyzer

structure

Read-onlyIdempotent

Perform structural analysis of source code with actions for outlining, complexity metrics, class hierarchy, and symbol exploration.

Instructions

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}]}].

Input Schema

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

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