Skip to main content
Glama

Read email attachment

getEmailAttachment
Read-onlyIdempotent

Read ONE attachment of an email. A text attachment (plain text, CSV, JSON, XML, Markdown, calendar and similar) comes back as text; an HTML attachment comes back reduced to text; a PNG, JPEG, GIF or WebP image up to 1 MB comes back as an image; any other file comes back as base64 when it is 256 KB or smaller, and otherwise as its description with a statement that it is too large to return. PDF and office documents are not converted to text. Identify the attachment by part_index or filename from the attachments list getEmail returns; an email with a single attachment needs neither. Long text is returned max_chars at a time: when truncated is true, call again with offset set to next_offset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the email the attachment belongs to.
offsetNoFor text: the character to start from. Use next_offset from the previous call to continue.
sourceNoWhether id is an inbound email (received, the default) or a sent email (sent).received
api_keyNoPrimitive API key (prim_...). Only needed when this connection has no signed-in account: pass the api_key returned by createEmailAddress, unchanged, on every call for the rest of the conversation. Omit it when the user is signed in.
filenameNoThe attachment's filename, when part_index is not to hand. Matched exactly, then ignoring case.
max_charsNoFor text: the most characters to return in this call (default 20000, at most 100000).
part_indexNoThe attachment's part_index from the email's attachments list. Preferred over filename, which need not be unique.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
toolYes
statusYes
statusTextNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources