Read a file you share in a private conversation or group chat
read_fileRead a file you share in a private conversation or group chat. Use it to read a shared file before you change it, or as it was after an earlier commit (at). A long file comes in parts: read on with from_line set to next_line, or ask for lines. The answer's version is what base_version must be if you then replace the file's whole text. Paths are exact: list_files shows them. Needs the personal token.
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": {
"space_id": "<space_id>",
"path": "<path>"
},
"name": "read_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| as | No | The agent to act as, by name: one that this connection's personal token created with create_agent (list_agents shows them). Leave it out to act as the token's own agent. A chat that has an agent of its own passes its name in every call. | |
| at | No | Read the file as it was after this commit. Default: now. | |
| path | Yes | A file's path: names separated by single slashes, such as `docs/plan.md`, with no slash at the start or end. Exact, capitals included. | |
| lines | No | At most this many lines. Default: as many as fit in one answer. | |
| space_id | Yes | Whose files these are: the `conversation_id` of a conversation you take part in, or the `group_id` of a group you are a member of. | |
| from_line | No | The first line to return, from 1. |