Skip to main content
Glama

Read File

read_file
Read-onlyIdempotent

Read the text content of a Google Doc, Sheet, or Slides presentation. Docs export as plain text, Sheets as CSV, Slides as plain text. For large files, returns a size warning instead of content — use max_chars and offset to read in chunks.

file_id also accepts a ShareWatch handoff code of the form SW-XXXXXXXX. The user gets one by opening a file from Google Drive with ShareWatch, and it stands for that file until it goes unused for 30 days. The result always reports the real file_id, so use that value for any follow-up call rather than the code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabNoFor Google Sheets only: read a single named tab instead of the whole spreadsheet. Large spreadsheets refuse whole-file reads and list their tab names; pass one of those exact names here.
offsetNoCharacter offset to start reading from. Use with max_chars to paginate through large files.
file_idYesThe Google Drive file ID, or a ShareWatch handoff code like SW-7K2MPQ4B that the user was given when they opened a file from Drive
max_charsNoMaximum characters to return. Use this for large files to avoid consuming too much context. Omit to let the server decide (returns full content for small files or a size warning for large ones).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
linksNo
maskedNotrue when sensitive text in this content was replaced with tokens like SW(48):… before it was sent; see mask_note
offsetNo
contentYes
file_idYes
trashedNo
versionNo
file_nameYes
mask_noteNowhat the tokens are and how to treat them; present only when masked
mime_typeYes
truncatedNo
sheet_tabsNo
total_charsNo
alternativesNo
partial_readNoWhy the content is less than the whole file, or absent entirely. Empty means a complete read. When set, do NOT paginate with offset unless the text says the rest is reachable that way

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / tab
      Added value: +{
      +  "description": "For Google Sheets only: read a single named tab instead of the whole spreadsheet. Large spreadsheets refuse whole-file reads and list their tab names; pass one of those exact names here.",
      +  "type": "string"
      +}
  2. Changed2 schema fields changed
    • addedOutput schema / properties / mask_note
      Added value: +{
      +  "description": "what the tokens are and how to treat them; present only when masked",
      +  "type": "string"
      +}
    • addedOutput schema / properties / masked
      Added value: +{
      +  "description": "true when sensitive text in this content was replaced with tokens like SW(48):… before it was sent; see mask_note",
      +  "type": "boolean"
      +}
  3. Changed3 schema fields changed
    • removedOutput schema / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / alternatives / items / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / links / items / additionalProperties
      Removed value: -false
  4. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, non-destructive), the description discloses important behaviors: export formats, size warning instead of content for large files, the need to chunk with max_chars/offset, the handoff code substitution and its 30-day validity, and the fact that the result reports the real file_id. This is substantial behavioral context that goes far beyond what annotations provide.

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 two concise paragraphs with no wasted words. The primary purpose is front-loaded in the first sentence, and the second paragraph addresses the handoff code without clutter. Every sentence contributes meaningful information, and the structure is easy to scan.

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 tool's complexity (multiple file types, large-file handling, handoff codes, output schema), the description covers all essential aspects: what it reads, how output is formatted, how to paginate, and a special input mode. It also references the output schema implicitly by describing return behaviors. Nothing critical is missing for correct invocation.

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?

The input schema already has 100% coverage with detailed descriptions for all four parameters. The description adds extra value by explaining how to combine max_chars and offset for chunking, the behavior when max_chars is omitted (server decides), and the specificity of the handoff code for file_id. This enriches the semantics, though the schema already does a good job.

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 clearly states the tool reads text content from Google Docs, Sheets, and Slides, and specifies the export formats (plain text, CSV, plain text). This is a specific verb+resource that naturally distinguishes it from create/update/delete siblings and from describe_slides or preview_slides which serve different purposes.

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

Usage Guidelines4/5

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

It provides practical context such as handling large files with max_chars/offset and explains the handoff code behavior. However, it does not explicitly mention when to use this tool versus competing read-like alternatives (e.g., describe_slides for slide structure), so it lacks explicit exclusion guidance but still gives clear situational usage.

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