prune_context
Extract a minimal, hallucination-resistant context contract for a function or method, preserving exact type signatures and dependencies while cutting input tokens by over 80%.
Instructions
Extracts a minimal, hallucination-resistant context contract for a given function or method. Reduces input tokens by >80% while preserving exact type signatures and dependencies across project modules.
Args: file_path: Absolute or relative path to the Python source file. target_symbol: Identifier of the function or method (e.g. 'procesar_orden' or 'OrderService.procesar_orden'). format: Desired output format: 'stubs' (default, optimal for code LLMs), 'turtle' (RDF), 'json', or 'nl'. include_body: Whether to include the raw source code body of the target function. project_root: Optional root directory of the project (auto-detected if omitted).
Returns: The compact pruned contract string.
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": {
"file_path": "<file_path>",
"target_symbol": "<target_symbol>"
},
"name": "prune_context"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | stubs | |
| file_path | Yes | ||
| include_body | No | ||
| project_root | No | ||
| target_symbol | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |