Skip to main content
Glama

drive_file_read

Retrieve a Google Drive file's metadata or content by its ID. Export Docs, Sheets, and Slides content, download other files, and write binary content to a local path.

Instructions

Read a single Drive file by id. format: "metadata" (default) returns only metadata (including md5Checksum/sha1Checksum/sha256Checksum when available); format: "content" additionally fetches the file's actual content — exported for Google-native files (Docs/Sheets/Slides/...; see export_mime_type), downloaded as-is otherwise. Folders and shortcuts are rejected with an actionable error in content mode. Text content is returned inline; binary content is refused inline and requires output_file. When output_file is set, writes the content to that path and returns a short YAML summary instead of the inline body. Set verify: true (only with format: "content", only for non-Google-native files) to locally recompute the SHA-256 checksum of the fetched bytes and check it against Drive's reported sha256Checksum, failing clearly on a mismatch. Read-only. Mirrors omni-dev drive read. Output is YAML.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNo`metadata` (default) returns only the file's metadata; `content` additionally fetches its actual content — exported for Google-native files (Docs/Sheets/Slides/...), downloaded as-is otherwise.
verifyNoOnly valid with `format: "content"`. When true, locally recomputes the SHA-256 checksum of the fetched bytes and checks it against Drive's reported `sha256Checksum`. Only supported for non-Google- native files — Drive never returns a checksum for exported content, so this errors immediately on a Google-native file. Fails clearly on a mismatch or a missing checksum.
accountNoSelects a named Drive account instead of the ambient `--account`/`OMNI_DEV_DRIVE_ACCOUNT` resolution — e.g. `work`. Omit to use the resolved default account (or the legacy single-account credentials, if no named accounts are configured). Call `drive_account_list` to discover configured names.
file_idYesDrive file id (from `drive_search`, or the `id` segment of a Drive URL). Required.
output_fileNoOnly valid with `format: "content"`. When set, writes the fetched content to this path and returns a short YAML summary instead of the inline body — required for binary content (this tool refuses to return it inline), and recommended for large files that would exceed the response size limit.
export_mime_typeNoExport MIME type for a Google-native file's content — only relevant with `format: "content"`, ignored otherwise. Defaults: Google Docs -> text/markdown, Sheets -> text/csv (first sheet only), Slides -> text/plain. Required for every other Google-native type (Forms, Drawings, Apps Script, Sites, ...); the error names the file's actually supported export MIME types.
Behavior5/5

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

No annotations exist, so the description carries the full load — and it excels. It discloses read-only semantics, exact behavior differences between metadata/content modes, binary content refusal and the workaround, export default for Docs/Sheets/Slides, error naming behavior for unsupported export types, and the verify flow including how it fails on Google-native files. This is unusually complete behavioral disclosure.

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?

Dense but disciplined. It opens with the primary action and default mode, then elaborates in a logical cascade: mode → content fetch behavior → binary handling → output_file → verify. Each sentence carries distinct information with no repetition of schema text. Slightly dense (long sentences), but front-loaded and efficiently organized for a 6-parameter tool.

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 tool with 6 parameters and no output schema, this description is exceptionally complete. It covers input modes, content-type handling, output formats, all parameter interactions, failure semantics on checksum mismatch, and even the mirror command. An agent has everything needed to invoke this tool correctly across all supported scenarios, including edge cases like binary or oversized content.

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 coverage is 100%, but the description meaningfully augments it beyond the JSON — e.g., that 'format: metadata' returns checksums when available, that content is exported for Google-native files, that binary content is refused inline, and that output_file yields a YAML summary. The verify description in the prose adds behavioral constraints not obvious from the bare property docs. This exceeds the schema's literal text by clarifying mode interactions.

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 leads with a crystal-clear statement — 'Read a file by id' — and immediately disambiguates its two modes ('metadata' vs 'content'). It precisely explains what each mode returns, how Google-native files are handled, and what 'content' mode does beyond metadata. There is no ambiguity about the tool's core purpose or its primary input.

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?

The description gives strong operational guidance: when to use content mode, when binary requires output_file, when verify is valid, and how export_mime_type affects native files. It implicitly signals usage ('Set verify: true for integrity checking'). It does not explicitly compare to drive_search/drive_list siblings, but for a read operation the mode-selection guidance is more pertinent and well covered.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rust-works/omni-dev'

If you have feedback or need assistance with the MCP directory API, please join our Discord server