parse_ast
parse_astParse code from file paths or raw content into an Abstract Syntax Tree, supporting multiple languages for structural inspection.
Instructions
Parse code and return the Abstract Syntax Tree (AST). Supports multiple languages including JavaScript, TypeScript, Python, Go, Rust, Java, C, C++, and more.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | Code content to parse directly (either file_path or content required) | |
| language | No | Language name (auto-detected from file path if not provided) | |
| file_path | No | Path to the file to parse (either file_path or content required) | |
| max_depth | No | Maximum depth of AST to return (default: 5) | |
| max_nodes | No | Maximum AST nodes materialized in the response (default: 10000) | |
| max_text_bytes | No | Maximum UTF-8 text retained per AST node (default: 2000) | |
| redact_secrets | No | Redact common secrets in AST text fields (default: true) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| meta | Yes | ||
| error | No | ||
| message | No | ||
| success | Yes | ||
| schema_version | Yes |