Skip to main content
Glama

File Read

file_read
Read-only

Reads a plain text file from the local filesystem by its absolute path — the primary, default tool for reading a local text file (use this unless the file is a PDF, Word, Excel, or PowerPoint document, which have their own readers). Reads anywhere on this Mac — home, external disks, cloud drives, /tmp — with one exception: credential and identity locations (keychains, ~/.ssh, ~/.aws, browser logins, another user's home, Time Machine backups) are never read. Supports .txt, .md, .csv, .json, .xml, .log, .yaml, .toml and common code file types; auto-detects UTF-8 with Latin-1/Windows-1252 fallback. For files in OneDrive use onedrive_read_file, in Google Drive gdrive_read_file; for PDFs pdf_read, Word word_read, Excel excel_read.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the file
offsetNoStart reading at this byte offset (default 0)
max_bytesNoMaximum bytes to read (default 1 MB, max 10 MB)
force_downloadNoIf the file is stored in the cloud and evicted from this Mac (dataless), request the download and wait for it instead of failing. Off by default: a download can take minutes and use metered data, so it is the caller's decision.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesResolved absolute path of the file
bytesYesTotal file size in bytes
offsetNoByte offset the read started at
contentYesDecoded file text content
encodingNoEncoding used to decode (utf8 | cp1252 | latin1)
truncatedNoTrue if more content remains beyond what was returned

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / force_download
      Added value: +{
      +  "description": "If the file is stored in the cloud and evicted from this Mac (dataless), request the download and wait for it instead of failing. Off by default: a download can take minutes and use metered data, so it is the caller's decision.",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changed
    • removedInput schema / properties / force_download
      Removed value: -{
      -  "description": "If the file is stored in the cloud and evicted from this Mac (dataless), request the download and wait for it instead of failing. Off by default: a download can take minutes and use metered data, so it is the caller's decision.",
      -  "type": "boolean"
      -}
  3. Changed1 schema field changed
    • addedInput schema / properties / force_download
      Added value: +{
      +  "description": "If the file is stored in the cloud and evicted from this Mac (dataless), request the download and wait for it instead of failing. Off by default: a download can take minutes and use metered data, so it is the caller's decision.",
      +  "type": "boolean"
      +}
  4. Added

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds substantial behavioral context beyond that: it spells out the filesystem scope ('home, external disks, cloud drives, /tmp'), the one class of locations never read (keychains, ~/.ssh, ~/.aws, browser logins, another user's home, Time Machine backups), supported file types, and encoding fallback behavior (UTF-8 with Latin-1/Windows-1252). No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized for the tool's complexity and is front-loaded with the primary purpose. It is structured in three clear segments: (1) when to use it, (2) scope/exceptions and supported types/encoding, (3) explicit alternative tools. Every sentence earns its place; there is no filler, and the disambiguation is extremely valuable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the read-only annotations (safety covered), a 100%-described schema, and an existing output schema, the description covers everything an agent needs: purpose, scope, exclusions, supported formats, encoding, and explicit routing to sibling tools. No missing operational details such as return values (output schema exists) or credentials (readOnlyHint implies no auth side effects).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% because every parameter has a description in the input schema waters (path, offset, max_bytes, force_download). The description reinforces that 'path' is an absolute path and that the file should be plain text, but it does not add meaning for offset/max_bytes/force_download beyond what the schema already explains. Per the calibration rule, a baseline of 3 applies when schema coverage is high.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource: 'Reads a plain text file from the local filesystem by its absolute path.' It also distinguishes itself from other readers by name (onedrive_read_file, gdrive_read_file, pdf_read, word_read, excel_read) and by the 'use this unless...' clause, so an agent can immediately tell it apart from siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool ('default tool for reading a local text file') and when not to: 'unless the file is a PDF, Word, Excel, or PowerPoint document, which have their own readers.' It names exact alternatives for OneDrive, Google Drive, PDF, Word, and Excel, and even lists exclusions (credential locations) that should not be read.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources