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

NameRequiredDescriptionDefault
pathYesAbsolute path to the file
offsetNoStart reading at this byte offset (default 0)
max_bytesNoMaximum bytes to read (default 256 KB, max 2 MB). A longer file comes back with truncated=true and next_offset: pass next_offset as offset to continue.
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

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 | utf16le | utf16be)
truncatedNoTrue if more content remains beyond what was returned
next_offsetNoByte offset to pass as offset to read on (present only when truncated)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / encoding / description
      Previous value: -"Encoding used to decode (utf8 | cp1252 | latin1)"New value: +"Encoding used to decode (utf8 | cp1252 | latin1 | utf16le | utf16be)"
  2. Changed2 schema fields changed
    • changedInput schema / properties / max_bytes / description
      Previous value: -"Maximum bytes to read (default 1 MB, max 10 MB)"New value: +"Maximum bytes to read (default 256 KB, max 2 MB). A longer file comes back with truncated=true and next_offset: pass next_offset as offset to continue."
    • addedOutput schema / properties / next_offset
      Added value: +{
      +  "description": "Byte offset to pass as offset to read on (present only when truncated)",
      +  "type": "integer"
      +}
  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. 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"
      -}
  5. 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"
      +}
  6. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint and destructiveHint=false, so the safety profile is covered; the description goes well beyond that by naming the specific locations that are never read (keychains, ~/.ssh, ~/.aws, browser logins, other users' homes, Time Machine), disclosing encoding auto-detection with a Latin-1/Windows-1252 fallback, and noting that cloud-evicted files fail by default. These are behaviors an agent cannot infer from structured fields.

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

Conciseness4/5

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

Front-loaded with the core verb+scope, then constraints, then alternatives — a sound structure. It is dense and long for a read tool (three packed clauses plus a long prohibition list), but nearly every clause carries unique routing or safety information, so little is expendable.

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?

All four parameters are documented in the schema, an output schema exists so return values need no prose, and annotations cover the safety profile. Given that, the description supplies everything remaining an agent needs: default status, format exclusions, cloud-store routing, security boundaries, and encoding behavior.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds meaningful semantics for the 'path' parameter by enumerating supported extensions (.txt, .md, .csv, .json, .xml, .log, .yaml, .toml, common code types) and describing how content is decoded, which the schema does not. Offset/max_bytes/force_download details are already in the schema and are not duplicated.

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?

States a specific verb and resource ('Reads a plain text file from the local filesystem by its absolute path') and immediately positions itself as the primary/default text-file reader. It explicitly names the document-format siblings (PDF, Word, Excel, PowerPoint) that require a different tool, so an agent can distinguish it without opening any schema.

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?

Explicit when-to-use ('use this unless the file is a PDF, Word, Excel, or PowerPoint document') plus per-source routing: OneDrive -> onedrive_read_file, Google Drive -> gdrive_read_file, PDFs -> pdf_read, Word -> word_read, Excel -> excel_read. This is exactly the when/when-not/alternatives triad.

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