Skip to main content
Glama

export

Export emails to MIME, EML, Markdown, JSON, or CSV for archival, forensics, or programmatic processing. Export single messages, batch search results, or full conversations with optional attachments.

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 non-read-only and non-destructive, and the description adds behavioral details: default values (includeAttachments, order), format restrictions per target, and parameter combinations. However, it does not explicitly state that files are written to local disk, though savePath/outputDir imply this.

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 dense paragraph but is well-structured, starting with the overarching purpose and then breaking down each target. It front-loads key information but is somewhat lengthy; could be slightly more concise without losing detail.

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 high parameter count (14) and no output schema, the description is very thorough. It covers all four targets, parameter dependencies, format compatibility, and defaults. It lacks explicit mention of error handling or permissions, but overall it provides sufficient context for correct invocation.

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%, so parameters have descriptions. The description adds context by grouping parameters under targets and clarifying how they interact (e.g., id required for message/mime, emailIds vs searchQuery for messages). It also explains format enum applicability per target, which is not obvious from the schema alone.

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: exporting emails to file formats for archival, forensics, or programmatic processing. It distinguishes four distinct targets (message, messages, conversation, mime) each with specific behavior, differentiating it from sibling tools like read-email or search-emails which do not save to files.

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 explicit guidance on when to use each target: message for single email, messages for batch, conversation for full thread, mime for raw MIME. It also notes format variations by target, but does not explicitly compare to alternatives like read-email for retrieval, which could help an agent choose between tools.

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-mcp'

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