Tools · Files and code
read_file
Read-onlyRead a file from the local project. Text files return line-numbered content; Word/Excel/PowerPoint/HTML/CSV documents are extracted to clean Markdown; images and PDFs return as viewable media.
When to use: Use this to inspect source files, config files, logs, and artifacts in the local project.
Example
Run for real by scripts/tool-examples.py in a small demo project, with Haiku 5.5 where the tool calls a model. The output is exactly what the tool returned.
The call
{
"tool": "read_file",
"arguments": {
"path": "src/pricing.py"
}
}Real output
1: """Seat pricing for the demo app."""
2:
3: PLANS = {"starter": 12.0, "team": 29.0}
4:
5:
6: def price(plan: str, seats: int) -> float:
7: return PLANS[plan] * seatsParameters
| Name | Type | Description |
|---|---|---|
| path* | string | Relative file path |
| start_line | number | 1-based starting line number |
| max_lines | number | Maximum number of lines to return |
* required
More in Files and code
Read, search and edit the project; run commands, code and git.