Skip to content

Read

Use these tools instead of shell cat, head, tail, cut, ls, or stat.

Pass path, or paths for a batch. The same range applies to every file in a batch. A 300-line cap applies to batch reads.

NeedParameters
Full filepath
Absolute line rangestart_line, end_line (inclusive, not a count)
Count from a linestart_line, max_lines (omit end_line)
First N linesmax_lines, mode omitted or all
Head or tailmode: head or tail, plus max_lines
Log tailmode:"tail", max_lines:40. Each line is cut at 300 characters. max_line_length overrides. 0 disables the cut.
Binaryencoding:"base64"

content_hash is the full file, including on range and head/tail reads. Batch reads omit the top-level hash and put content_hash on each files[] entry.

detail is summary, normal (default), or full. Batch summary omits file bodies and keeps path and hash.

Do not use a tail cut when you need exact text for edit_file.

list_directory output_format: compact (default), json, tree, sizes.

directory_tree is the compact tree. Defaults: gitignore on, max_depth=2, max_nodes=500. Structured output includes truncated and hidden_count.

get_file_info returns size, permissions, and dates. Pass paths for a batch. Use it after a write to confirm the host file, not only the write response.

Copy paths from list_directory or read_file. Do not retype them. Windows is case-insensitive, but a later tool may keep the spelling you passed.