Skip to main content
Glama
wrale

mcp-server-tree-sitter

by wrale

get_ast

Generate an abstract syntax tree (AST) for a file, returning it as a nested dictionary. Specify project, file path, depth, and whether to include node text for detailed code analysis.

Instructions

Get abstract syntax tree for a file.

    Args:
        project: Project name
        path: File path relative to project root
        max_depth: Maximum depth of the tree (default: 5)
        include_text: Whether to include node text

    Returns:
        AST as a nested dictionary
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_textNo
max_depthNo
pathYes
projectYes
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions the return format ('AST as a nested dictionary'), it lacks critical details such as whether this is a read-only operation, potential performance impacts, error conditions (e.g., invalid file paths), or how max_depth=null behaves. For a tool with 4 parameters and no annotation coverage, this is insufficient.

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 efficiently structured with a clear purpose statement followed by a parameter list and return value. Every sentence earns its place, and it's front-loaded with the core functionality. There's no redundant or verbose language, making it easy to parse quickly.

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 (4 parameters, no annotations, no output schema), the description is partially complete. It covers parameters well but lacks behavioral context (e.g., error handling, performance) and doesn't explain the nested dictionary structure of the AST return value. Without an output schema, more detail on the return format would be helpful, making this adequate but with clear gaps.

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?

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains all 4 parameters: project ('Project name'), path ('File path relative to project root'), max_depth ('Maximum depth of the tree'), and include_text ('Whether to include node text'), including default values. This compensates well for the schema's lack of descriptions, though it doesn't detail format constraints (e.g., path syntax).

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's purpose with a specific verb ('Get') and resource ('abstract syntax tree for a file'), distinguishing it from siblings like get_file (which retrieves raw file content) or get_symbols (which extracts symbols). The description directly addresses what the tool does without being vague or tautological.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like get_file (for raw content) or get_node_types (for node type analysis), nor does it specify prerequisites or contexts where this tool is preferred. Usage is implied only by the tool's name and purpose.

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

Related 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/wrale/mcp-server-tree-sitter'

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