Skip to main content
Glama
pwno-io

treesitter-mcp

by pwno-io

treesitter_cursor_walk

Get a cursor-style view of the AST at a specific code position, showing the focus node, ancestors, siblings, and children to understand the syntax tree context.

Instructions

Return a cursor-style view (focus node + context) at a point.

Args: file_path: Path to the source code file row: Row number (0-based) column: Column number (0-based) max_depth: Maximum depth of the AST to return. output_file: If provided, writes result to this file instead of returning. Useful for large outputs to prevent context overload.

Returns: Dictionary with focus, ancestors, siblings, and children OR if output_file is set: {"status": "written", "output_file": "...", "bytes_written": N}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowYes
columnYes
file_pathYes
max_depthNo
output_fileNo
Behavior4/5

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

With no annotations provided, the description carries the full transparency burden. It discloses the output_file side effect ('writes result to this file instead of returning') and clearly describes the return shape or alternative written status. It does not mention error cases or file overwriting behavior, but the main behavioral traits are transparent.

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 well-structured with Args and Returns sections, uses concise single-line explanations for each parameter, and includes only the necessary extra context about output_file. There is no fluff or redundancy; every sentence earns its place.

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?

Given no annotations and no output schema, the description provides a solid foundation: purpose, all parameter semantics, and return shape. It is enough to invoke the tool correctly, but the return dictionary is only vaguely described as 'focus, ancestors, siblings, and children' without field types or structure, leaving some ambiguity for a complex AST tool.

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 schema has no parameter descriptions (0% coverage), but the description's Args section explains every parameter: file_path is a path, row/column are 0-based, max_depth controls AST depth, and output_file writes to a file instead of returning. This fully compensates for the schema gaps and adds useful context such as the rationale for output_file.

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 opens with a specific verb and resource: 'Return a cursor-style view (focus node + context) at a point.' It also lists the returned components (focus, ancestors, siblings, children), which clearly differentiates it from sibling tools like treesitter_get_node_at_point that likely return only a single node.

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

Usage Guidelines3/5

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

The description implies usage through the 'cursor-style view' phrasing and provides a concrete guideline for the output_file parameter: 'Useful for large outputs to prevent context overload.' However, it does not explicitly state when to prefer this tool over alternatives or mention any exclusions, so it stops short of clear sibling differentiation.

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/pwno-io/treesitter-mcp'

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