ReadFileTool
Reads a text file's content, sandboxed to external storage via PathValidator. Files with an unrecognized extension are scanned for null bytes in the first 8 KB and rejected as binary if any are found. Output is truncated to the max_lines param and to a hard cap of ~1 MB of characters (MAX_CHARS); the file is streamed through a bounded buffer, so arbitrarily large files or single huge lines never load fully into memory. Requires READ_EXTERNAL_STORAGE on API ≤32; uses File API access on API 33+. Under scoped storage (API 30+) non-media files created by other apps are not readable. Output: path, content (newline-joined lines), lines_returned, truncated, and truncated_by ("max_lines", "max_chars", or null).