mcp-server-tree-sitter

by wrale
MIT License
33
  • Apple
  • Linux

get_ast

Retrieve the abstract syntax tree (AST) of a file as a nested dictionary. Specify the project, file path, maximum 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

NameRequiredDescriptionDefault
include_textNo
max_depthNo
pathYes
projectYes

Input Schema (JSON Schema)

{ "properties": { "include_text": { "default": true, "title": "Include Text", "type": "boolean" }, "max_depth": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Max Depth" }, "path": { "title": "Path", "type": "string" }, "project": { "title": "Project", "type": "string" } }, "required": [ "project", "path" ], "title": "get_astArguments", "type": "object" }
ID: k35mqkr8j9