Skip to main content
Glama
pwno-io

treesitter-mcp

by pwno-io

treesitter_get_node_at_point

Get the AST node at a given line and column in a source file. Specify file, row, and column to retrieve the exact syntax tree node at that position.

Instructions

Return the AST node covering a specific point (row, column).

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. 0 for just the node. output_file: If provided, writes result to this file instead of returning. Useful for large outputs to prevent context overload.

Returns: AST node as dictionary 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?

No annotations are provided, so the description carries the full burden. It explains the output_file behavior and its rationale (preventing context overload), the max_depth semantics, and the return format. It does not cover error cases or node selection logic when multiple nodes cover a point, but overall it is 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 a one-sentence purpose, a concise Args list, and a Returns section. Every line adds value, and the output_file note is succinctly integrated. No wasted words.

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?

The description covers the core functionality, all parameters, and the return format including the output_file alternative. Minor missing details include how overlapping nodes are resolved and error handling, but these are not critical for a read-only query 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 description provides a clear explanation for each of the five parameters, including row/column being 0-based and the meaning of max_depth. This fully compensates for the input schema's lack of descriptions (0% 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 'Return the AST node covering a specific point (row, column).' It uses a specific verb and resource, and the point-based scope distinguishes it from siblings like treesitter_get_node_for_range and treesitter_get_ast.

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 clear context for when to use the tool (querying a single point) but does not explicitly mention alternatives or exclusions. The context is sufficient for an agent to differentiate from range-based or whole-tree tools.

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