prune_file
Extracts semantic interfaces, signatures, types, and sanitized raises from a source file, replacing implementation bodies with stubs so agents can inspect dependency APIs without ingesting raw code.
Instructions
Extract semantic interfaces, types, pydantic models, sanitized raises, and signatures from a source file (path) at a given pruning depth ('full' retains full AST with sanitized raises, 'interface' replaces procedural bodies with ... stubs [default], or 'nominal' retains top-level symbol declarations only) and language ('python' [default], 'typescript', 'javascript', 'go', 'java'), optionally stripping docstrings (strip_docs, default false). 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.
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": {
"path": "<path>"
},
"name": "prune_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute or relative path to the source file | |
| depth | No | Pruning depth: 'full' (complete AST with sanitized raises), 'interface' (signatures, types, and '...' stubs; default), or 'nominal' (top-level symbol names only) | 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 |