prune_file
Extract semantic interfaces, types, models, and signatures from a source file at a chosen depth to inspect APIs without reading raw implementation code.
Instructions
Extract semantic interfaces, types, pydantic models, sanitized raises, and signatures from a source file (path) at a given pruning depth ('full', 'interface', or 'nominal') and language, optionally stripping docstrings (strip_docs), 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. For multi-module dependency graphs, use resolve_context_bundle instead. 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 |