get_ast_context
Retrieve the enclosing treesitter scope chain (functions, classes, blocks) at a specified line and file to understand code structure.
Instructions
Get the treesitter scope chain at a position (shows enclosing functions, classes, blocks)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file": "<file>",
"line": "<line>"
},
"name": "get_ast_context"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Absolute or relative file path | |
| line | Yes | Line number (1-indexed) |