Skip to main content
Glama
mail-mcp-server

mail-mcp-server

getMessage

getMessage
Read-onlyIdempotent

Read a locally stored email to get headers, a Markdown body chunk, and its attachment list; use nextOffset to continue the body when more text is needed.

Instructions

Read one locally stored message: headers, a body chunk as Markdown, and an attachment list. nextOffset continues only the body; headers and the attachment list are returned on each call. If body is absent, saved body text is unavailable; inspect state and error rather than assuming the original message was empty.

When reviewing many messages, do not open every card; choose from the list first. To check a message, use a small maxChars, and continue with nextOffset if it looks relevant.

To read an attachment, call getAttachment with the same connection and key, and file=attachments[].file. Use file, not name or path. The list includes files extracted from attached archives and messages; parent is the containing attachment's file. For the conversation, call getThread with the same connection and key.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "connection": "<connection>",
      "key": "<key>"
    },
    "name": "getMessage"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesLocal message key from listMessages, search or getThread in this connection; use key, not the Message-ID header
offsetNoBody character offset, default 0. To continue, keep the same connection and key and use nextOffset from this tool. Stop when there is no nextOffset
maxCharsNoBody characters per chunk: 1 to 100000, default 20000; larger values are capped at 100000
connectionYesConnection name from listConnections

Output Schema

NameRequiredDescriptionDefault
ccNoCc recipients as Name <address>.
toNoTo recipients as Name <address>.
keyYesMessage key.
bodyNoChunk of the saved body as Markdown; [redacted:<kind>] marks a hidden secret. Absent when saved body text is unavailable; this does not prove the original body was empty.
dateNoDate from the message header; absent when missing.
fromNoSenders as Name <address>.
readNoRead in the mailbox as of the last sync; absent when unknown.
errorNoWhy the message failed; present when state is failed.
stateYesconverted (complete), downloaded (saved, text not processed yet) or failed (see error).
folderYesFolder path in the mailbox; not the folder key used by listMessages/search.
labelsNoMailbox labels of this message as of the last sync, such as Gmail's Inbox, Sent or user labels; empty when it has none. Absent when unknown or when the mailbox has no labels.
offsetYesCharacter position of this chunk.
flaggedNoFlagged or starred in the mailbox as of the last sync (not sender importance); absent when unknown.
subjectNoSubject.
inReplyToNoIn-Reply-To header.
localPathYesAbsolute message directory, readable directly: message.eml (original), body.md, attachments/.
messageIdNoMessage-ID header.
bodyLengthYesLength of the whole body in characters; 0 without a body.
nextOffsetNoPass as offset to get the next chunk; absent at the end.
referencesNoReferences header message IDs.
attachmentsYesAttachments, including files unpacked from attached archives and messages. Empty when none are found or the saved MIME cannot be read. Pass an entry's file to getAttachment with this message's key and connection.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare a safe idempotent read, yet the description still adds real behavior: nextOffset advances only the body while headers and the attachment list repeat on every call, and a missing body means the saved text is unavailable rather than an empty message. That last warning is the kind of error-semantics guidance annotations cannot convey, though there is no mention of rate limits or cost.

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 what is returned, then pagination, then routing to siblings – a logical order with no filler sentences. It runs a little long across four paragraphs, but each carries distinct information rather than restating the name or schema.

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?

With only four parameters and an output schema present, the description covers what an agent still needs: chunked-body continuation, repeated header/attachment fields, absent-body semantics, and the follow-up calls for files and threads. Nothing needed to invoke it correctly or chain from its output is missing.

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 the baseline is 3; the description goes beyond it by explaining that offset must be paired with the previous nextOffset under the same connection and key, and that the attachment list contains files extracted from archives with parent pointing at the containing attachment. This adds operational meaning the schema does not encode.

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?

First sentence gives a precise verb and resource plus the exact shape of the return: headers, a Markdown body chunk, and an attachment list. The 'locally stored' qualifier and explicit pointers to listMessages, getAttachment and getThread make it distinguishable from every sibling without opening a 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?

States when to prefer list-first triage over opening cards, recommends a small maxChars for screening, and tells the agent exactly which sibling to call for attachments (getAttachment with file=attachments[].file) and for conversation context (getThread). Both the when and the when-to-use-something-else are explicit.

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