Read File
read_fileRead the full contents of a file. Text files are returned as UTF-8 text; binary files are automatically detected and returned as base64.
Instructions
Read the full contents of a file. Text files are returned as UTF-8 text; binary files are detected automatically and returned as base64.
Args:
path (string): Absolute or relative path to the file.
Returns: file contents as text, or a note that the file is binary with base64 content.
Error Handling:
Returns an error if the path is outside allowed directories or matches a blocked pattern (e.g. .ssh, .aws).
Returns "File or directory not found" if the path does not exist.
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 | Path to the file to read |