Skip to main content
Glama

export

Export emails to multiple file formats for archival, forensics, or programmatic processing. Supports single messages, batch exports, full conversations, or raw MIME bytes.

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
targetNoExport target (default: message)
idNoEmail ID (target=message/mime, required)
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).
savePathNoFile path or directory (target=message)
includeAttachmentsNoInclude attachments (default: true for single, false for batch)
emailIdsNoEmail IDs to export (target=messages)
searchQueryNoSearch query to find emails (target=messages, alternative to emailIds)
queryNoFree-text search shortcut (target=messages). Equivalent to passing searchQuery: { subject: <query> }. Convenience alias for callers used to search-emails.
outputDirNoOutput directory (target=messages/conversation, required)
conversationIdNoConversation ID (target=conversation, required)
orderNoMessage order (target=conversation, default: chronological)
headersOnlyNoMIME headers only, no body (target=mime)
base64NoReturn base64 encoded (target=mime)
maxSizeNoMax content size in bytes (target=mime, default: 1MB)
Behavior4/5

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

Annotations indicate readOnlyHint=false and destructiveHint=false, so the description isn't required to cover safety but adds value by disclosing defaults (e.g., includeAttachments default varies), format constraints, and order parameter behavior. 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 a single coherent paragraph that is moderately long but well-structured and informative. Every sentence contributes meaning; there is no redundancy. A bulleted format might improve scannability, but the current structure is still effective.

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?

Given the tool's complexity (14 parameters, 4 targets, no output schema), the description covers all major aspects: target-specific behavior, format constraints, parameter dependencies, defaults, and ordering options. It leaves no major gaps for an AI agent to infer.

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 adds meaning beyond the schema by explaining how format enum values vary by target, that 'mime' is an alias for 'eml', and how searchQuery and query relate. This provides useful contextual information for parameter selection.

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 explicitly states the tool exports emails to file formats for archival, forensics, or programmatic processing. It details four distinct targets (message, messages, conversation, mime) with specific use cases, clearly differentiating from sibling tools like read-email or search-emails.

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 guidance on when to use each target and which formats are valid per target. It explains parameter dependencies and defaults. However, it does not explicitly state when not to use this tool or compare to alternatives in the sibling list.

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