smart_read
Reads files by automatically selecting the optimal detail level per code block based on query relevance, saving tokens while preserving all query-relevant information.
Instructions
Read a file with automatic resolution optimization.
Instead of choosing between full/map/signatures mode, SRP automatically selects the optimal resolution for each code block based on query relevance and token budget:
Blocks matching the query → FULL (complete source)
Related blocks → MEDIUM (signature + docstring)
Peripheral blocks → LOW (name only)
Irrelevant blocks → SKIP (omitted)
This saves 40-70% tokens vs full-file reads while preserving all query-relevant detail.
Args: file_path: Path to the file to read query: What you're looking for (improves relevance scoring) budget: Target token budget for the output (default: 1000)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | ||
| budget | No | ||
| file_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |