Skip to main content
Glama

Fetch Attachment Content (Drive)

drive_fetch_file_content
Read-onlyIdempotent

Read text content from Google Drive attachments in Classroom coursework, materials, or announcements. Converts Docs, Sheets, and Slides to text or CSV; binary files return metadata and link.

Instructions

Read the text content of a Google Drive file attached to Classroom coursework, materials, or announcements.

Handles each type appropriately:

  • Google Docs → exported as plain text

  • Google Sheets → exported as CSV

  • Google Slides → exported as plain text

  • text/csv/markdown/html/json/xml/rtf → downloaded directly

  • PDFs, images, and other binary files → returns metadata + link (content can't be rendered as text)

Args:

  • drive_file_id (string): The Drive file id from an attachment's driveFile.driveFile.id

  • response_format ('markdown' | 'json')

Returns: name, mime_type, size, link, and (when readable) content. Long content is truncated to a character limit with a note.

Error Handling:

  • 403/permission → the Drive scope may be missing; re-run npm run auth

  • 404 → the file id is wrong or you lack access to that file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
drive_file_idYesThe Drive file id of an attachment. Find it in the materials arrays returned by classroom_list_coursework / list_materials / dump_course (driveFile.driveFile.id).
response_formatNoOutput format: 'markdown' for human-readable or 'json' for raw datamarkdown

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior5/5

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

The description richly discloses behavior beyond the annotations: per-file-type export behavior, binary-file fallback to metadata and link, truncation with a note, and specific error handling for 403 and 404. Annotations already mark the tool read-only and idempotent, and the description adds valuable operational context without contradicting them.

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 well organized with a clear lead sentence followed by concise bullets for file-type handling, arguments, return value, and errors. Every section serves an operational purpose and the most important behavior is front-loaded.

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 no output schema, the description sufficiently explains what will be returned, how different file types are treated, what happens with binary files, and how to handle common errors. Combined with the annotations and complete input schema, an agent has everything needed to invoke the tool correctly and interpret results.

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%, so the baseline is 3. The description repeats the parameter names and enum values already present in the schema and adds only minor clarification about where drive_file_id comes from. It does not substantially extend the schema's parameter explanations, but it does not need to given full coverage.

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 states a specific action ('Read the text content') applied to a specific resource ('Google Drive file attached to Classroom coursework, materials, or announcements'). It clearly differentiates the tool from the sibling classroom_* tools, which primarily list or manage Classroom data rather than fetch and interpret attachment file contents.

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 clear context: use this when you have a Drive file id from a Classroom attachment and need its readable text content. It does not explicitly name sibling alternatives or state when not to use the tool, but the unique purpose and detailed handling instructions make the intended usage unambiguous.

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

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/ymr-gif/classroom-mcp-server'

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