Skip to Content

fs_read

Read a file on the machine, exactly as stored: text as text, anything else as base64. Up to 256 KiB per call by default (max_bytes up to 4 MiB); truncated says there is more, read on with offset. Paths holding keys and credentials (~/.ssh, ~/.aws, cmdop’s own folder and the like) are refused.

Arguments

Over MCP every tool also takes machine: the machine’s name or id, optional when only one machine is online.

NameTypeRequiredMeaning
max_bytesintegernoRead at most this many bytes (default 262144, at most 4194304).
offsetintegernoStart at this byte (default 0).
pathstringyesFile on the machine. Absolute, or relative to the user’s home folder; ~ is the home.

Result

NameTypeRequiredMeaning
datastringyes
encoding`“utf8”“base64”`yes
offsetintegeryes
pathstringyesThe file, resolved to an absolute path.
sizeintegeryesThe file’s whole size in bytes.
truncatedbooleanyesThe file goes on after what was returned; read again with a larger offset.

Examples

{ "name": "fs_read", "arguments": { "machine": "<machine>", "path": "<path>" } }

Limits

The call times out after 30 s (timed_out). Available since version 0.0.1. A refused or failed call returns one of the error codes.