Skip to main content
Glama

Drive Read File

drive_read_file
Read-onlyIdempotent

Read a Google Drive file's text without downloading it, paging about 8,000 characters at a time. Export Docs, Slides and Sheets as text, Markdown or CSV, and resume from a stored offset.

Instructions

Read the text of one Drive file without saving it, a page of about 8,000 characters at a time: Google Docs and Slides export as text (Docs also as Markdown), Sheets as CSV of the first sheet, and stored text files up to 5 MB (text, Markdown, CSV, JSON, XML, HTML) are downloaded. Binary files, folders, forms and drawings fail with invalid_input; use docs_read_document for a Doc's tabs, chips and footnotes (it renders the document itself, so its body_chars differ from this export's). Returns file_id, name, mime_type, format, exported_as, modified_at, web_url and the page as body, truncated, next_offset (pass it back as offset), body_chars and body_sha256 (length and hash of the whole text).

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": {
      "file_id": "<file_id>"
    },
    "name": "drive_read_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
formatNo'text' (default) returns plain text; 'markdown' returns a Google Doc as Markdown (headings, lists, tables, links). Other files read the same in both formats.text
offsetNoCharacter offset into the file's text to resume from: the next_offset of a truncated result. Omit (0) for the first page.
file_idYesDrive file ID: the id field of Drive and search_workspace results, or the long ID in a Drive, Docs, Sheets or Slides URL.

Output Schema

NameRequiredDescriptionDefault
nameNo
formatNo
file_idNo
web_urlNo
mime_typeNo
exported_asNo
modified_atNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.2.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds substantially more: page size (~8,000 chars), pagination via next_offset/offset, truncation semantics, the invalid_input failure class, and the full set of returned fields including body_chars and body_sha256 scoped to the whole text rather than the page. It even warns that body_chars differs from docs_read_document's value, which prevents a common cross-tool confusion.

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 action and scope, then supportable detail in a dense but well-ordered block. Every clause carries information, though the single very long sentence containing the file-type matrix and the return-field list is heavier to parse than necessary; splitting the return-field sentence would improve scanability without losing content.

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?

For a read tool with three simple parameters, full annotations and an output schema, nothing an agent needs is missing: supported types, failure modes, pagination, size limit, alternative tool, and return shape are all covered. The description arguably over-delivers by restating the return fields, but that redundancy is harmless rather than a completeness gap.

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?

With 100% schema coverage the schema already documents all three parameters, so the baseline is 3. The description adds real semantic value on top: the offset round-trip ('pass it back as offset'), the page size implied by truncation, and the note that format only changes behavior for Google Docs while other files read identically. It stops short of elaborating file_id sourcing beyond what the schema covers.

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 and resource ('Read the text of one Drive file without saving it') and immediately scopes the behavior by mime type: Docs/Slides as text, Sheets as CSV, stored text files up to 5 MB. It distinguishes itself from the nearest sibling by naming docs_read_document and explaining the different rendering (export vs. document render, hence differing body_chars).

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 conditions are given per file type, a hard exclusion list is provided ('Binary files, folders, forms and drawings fail with invalid_input'), and the alternative tool for Doc tabs/chips/footnotes is named with the condition that selects it. 'without saving it' also implicitly routes saving-oriented needs away from this tool.

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

Deploy Server

Other Tools