Skip to main content
Glama
gclluch
by gclluch

find_node_at_position

Identify the AST node at a given line and column in a Python file, along with its enclosing scope chain.

Instructions

Identify the AST node at a cursor position with its enclosing scope chain.

Args: path: Path to a .py file. line: 1-based line number. column: 0-based column offset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineYes
pathYes
columnYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It does provide crucial details such as line being 1-based and column being 0-based, and notes the output includes the scope chain. However, it omits error behavior (e.g., invalid file path or out-of-range coordinates) and does not explicitly state it is a read-only operation.

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 a single concise sentence for the core purpose followed by a compact, well-formatted argument list. It front-loads the key action and wastes no words, making it easy to parse quickly.

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?

For a simple tool with only three parameters and an existing output schema, the description covers the main operation and parameter semantics adequately. It is slightly incomplete in that it does not mention what happens on invalid input or no matching node, but it provides enough for basic correct invocation.

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 input schema contains no descriptions (0% coverage), so the inline argument documentation is vital. The description explains that path points to a .py file, line is 1-based, and column is 0-based, fully clarifying meaning and coordinate conventions. This precisely compensates for the schema's lack of detail.

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 function with a specific verb and resource—'Identify the AST node at a cursor position'—and adds the distinguishing detail that it also returns the enclosing scope chain. This sets it apart from sibling tools that list declarations or find usages, making the purpose unambiguous.

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?

No explicit usage guidance is provided; there is no mention of when to use this tool versus alternatives or any exclusions. The mention of 'cursor position' hints at an editor or IDE context, so usage is only implied rather than directly stated.

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/gclluch/py-ast-mcp'

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