Read Tool
Read a file's contents with line numbers.
REQUIRED: path (absolute path) OPTIONAL: limit (max lines), offset (start line, 0-indexed)
RULES:
- Always use absolute paths, never relative
- Use limit+offset for large files (read in chunks of 100-200 lines)
- Returns format: "N\tline_content" (tab-separated line number + content)
EXAMPLE:
{"name": "Read", "input": {"path": "/absolute/path/to/file.py"}}
EXAMPLE with range:
{"name": "Read", "input": {"path": "/absolute/path/to/file.py", "limit": 50, "offset": 100}}
Workflow
- Use absolute paths: Always provide the full absolute path to the file
- Read in chunks: For large files, use
limitandoffsetto read 100-200 lines at a time - Check line numbers: Output includes line numbers to reference specific locations
- Combine with edit: Read a file before editing to get exact content for
oldText