Read file
read_fileRead a UTF-8 text file from a workspace and return its content with line numbers. Use offset and limit to inspect specific line ranges before editing.
Instructions
Read a UTF-8 text file from the workspace and return its content with 1-based line numbers in the form 'N: '. Use this before editing a file, or to inspect specific line ranges with offset/limit. Do not use it for binary files (they are rejected), to search file contents (use grep), or to discover files (use list_files).
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": "read_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Workspace-relative path of the file to read. Absolute paths inside the workspace are also accepted. | |
| limit | No | Maximum number of lines to return. Defaults to 2000 and is capped at 2000. | |
| offset | No | 1-based line number to start reading from. Defaults to 1. | |
| workspace | No | Workspace name (see workspace_list). Defaults to the primary workspace. |