Skip to main content
Glama

export_thread

Save a whole email thread to a local file in markdown or JSON for keeping, sharing, or reading long conversations without loading them into context.

Instructions

Write a whole thread to a local file instead of returning it — for keeping, sharing, or reading a long conversation without loading it into the context. markdown (default): one section per message with From/To/Date/Subject and attachment names as inline code (never rendered as a link or image), sender authentication and the attachment list, and the body in a code fence that the message text cannot close (HTML-only mail is reduced to text). json: the parsed messages as get_thread returns them, HTML included. Both formats strip the same hidden characters (zero-width, bidi controls) as every tool result. Attachments are listed, not saved — use download_attachment for those. If MAILWARDEN_DOWNLOAD_DIR is set, destPath is resolved inside (and restricted to) that directory, as for attachments. The file holds mail text as the sender wrote it: untrusted content, now on disk. USE WHEN: the user wants a conversation saved or handed on, or a thread is too long to read in one piece. DO NOT USE: to read a thread (use get_thread). SIDE EFFECTS: writes a local file; never overwrites — an existing file gets a numeric suffix. The response's 'saved' field is the path actually used. Mailbox unchanged.

Input Schema

NameRequiredDescriptionDefault
formatNomarkdown
destPathYes
threadIdYes

Output Schema

NameRequiredDescriptionDefault
bytesYes
savedYes
messageCountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.23.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses per-format output behavior, hidden-character stripping, the never-overwrite numeric-suffix policy, destPath resolution restricted to MAILWARDEN_DOWNLOAD_DIR, that the response 'saved' field is the path used, and that the file holds untrusted sender content now on disk. This is rich behavioral context that annotations (readOnlyHint=false, destructiveHint=false, idempotentHint=false) only sketch.

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?

Front-loaded with the core purpose, then well-organized USE WHEN / DO NOT USE / SIDE EFFECTS blocks. It is long and dense, but essentially every sentence carries operative detail, so little is wasted.

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?

An output schema exists, yet the description still covers the file-write side effects, overwrite behavior, directory restriction, and untrusted-content caveat. For a tool that writes to disk, an agent has everything needed to call it correctly and set expectations.

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 description coverage is 0%, so the description must compensate, and it does: it defines the two format values (markdown default with its section layout, json mirroring get_thread with HTML included) and explains destPath resolution and the MAILWARDEN_DOWNLOAD_DIR restriction. threadId is only implied via the get_thread reference, leaving one parameter slightly under-specified.

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?

States a specific verb and resource — 'Write a whole thread to a local file instead of returning it' — and immediately contrasts with the returning behavior of get_thread. An agent can distinguish it from get_thread and download_attachment without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit USE WHEN (user wants a conversation saved/handed on, or thread too long to read) and DO NOT USE (to read a thread — use get_thread), plus a routing note that attachments are listed not saved and download_attachment should be used for those. Nothing is left to inference.

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