prune_file
Extract semantic interfaces, types, and signatures from a source file while replacing procedural bodies with AST stubs, enabling contract-only inspection without raw implementation or disk changes.
Instructions
Extract semantic interfaces, types, pydantic models, sanitized raises, and signatures from a source file while replacing procedural bodies with AST stubs. Use this when you only need to inspect contracts or APIs of an individual dependency without ingesting raw implementation code. Does not modify files on disk (pure in-memory AST operation).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute or relative path to the source file | |
| depth | No | Pruning depth: 'full', 'interface', or 'nominal' | interface |
| language | No | Programming language (python, typescript, javascript, go, java) | python |
| strip_docs | No | Whether to strip docstrings entirely |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Semantic interface stubs extracted via in-memory Tree-Sitter AST | |
| isError | Yes | True if pruning encountered a fatal parsing or file resolution failure |