Skip to main content
Glama

export

Export emails to file formats (MIME, Markdown, JSON, CSV) for archival, forensics, or programmatic processing. Supports single messages, batch search results, or full conversations.

Instructions

Export emails to file formats for archival, forensics, or programmatic processing. target=message (default) exports a single email by id to savePath — accepts mime/eml/markdown/json/csv. target=messages batch-exports either an explicit emailIds array or messages matching searchQuery (or query shortcut) into outputDir — accepts markdown/json/csv. target=conversation exports a full thread by conversationId into outputDir (chronological by default; pass order: "reverse" for newest-first) — accepts eml/mbox/markdown/json/html/csv. target=mime returns raw RFC-822 MIME bytes for id (use headersOnly for just headers, base64 for encoded transport, maxSize to cap at default 1MB). includeAttachments defaults to true for single-message exports and false for batch. Format support varies by target — see the format param enum.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoEmail ID (target=message/mime, required)
orderNoMessage order (target=conversation, default: chronological)
queryNoFree-text search shortcut (target=messages). Equivalent to passing searchQuery: { subject: <query> }. Convenience alias for callers used to search-emails.
base64NoReturn base64 encoded (target=mime)
formatNoExport format. Valid values vary by target: target=message accepts mime/eml/markdown/json/csv (mbox and html are conversation-only). target=conversation accepts eml/mbox/markdown/json/html/csv. target=messages (batch) accepts markdown/json/csv. mime is an alias for eml (same RFC822 bytes, .eml extension on disk).
targetNoExport target (default: message)
maxSizeNoMax content size in bytes (target=mime, default: 1MB)
emailIdsNoEmail IDs to export (target=messages)
savePathNoFile path or directory (target=message)
outputDirNoOutput directory (target=messages/conversation, required)
headersOnlyNoMIME headers only, no body (target=mime)
searchQueryNoSearch query to find emails (target=messages, alternative to emailIds)
conversationIdNoConversation ID (target=conversation, required)
includeAttachmentsNoInclude attachments (default: true for single, false for batch)
Behavior4/5

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

The description discloses important behaviors beyond annotations, such as default values (includeAttachments defaults per target), format support variations, and parameter roles across targets. It does not mention potential side effects like file overwriting or required permissions, but the openWorldHint=true annotation is partially addressed by explaining file writing aspects. No contradiction with annotations.

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?

The description is well-structured and front-loaded with purpose, then organized by target. While slightly verbose (repeating format lists), every sentence adds value. It could be more concise by avoiding redundancy, but it remains clear and scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (14 parameters, 0 required, nested objects, no output schema), the description covers parameter interactions, defaults, and target-specific behaviors comprehensively. It does not explain return values or error handling, but for an export tool focusing on file output, this is acceptable. The description is largely complete.

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 description adds significant meaning beyond the 100% schema coverage by tying parameters to specific targets (e.g., id required for message/mime, outputDir for messages/conversation), explaining shortcuts like query, and clarifying format compatibility. It provides cohesive context that the schema's individual descriptions lack, elevating it above the baseline of 3.

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's purpose: 'Export emails to file formats for archival, forensics, or programmatic processing.' It breaks down four distinct targets (message, messages, conversation, mime) with specific behaviors, distinguishing it from sibling tools like read-email or send-email. The verb 'export' and resource 'emails' are explicit, and the scope is well-defined.

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 provides clear context on when to use the tool (archival, forensics, processing) and explains each target's use case. However, it does not explicitly state when not to use it or compare with alternatives, though sibling tools like 'attachments' or 'read-email' are distinct. The absence of exclusions or direct comparisons prevents a score of 5.

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/littlebearapps/outlook-assistant'

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