Skip to main content
Glama

read_email

Retrieve complete email content with markdown formatting and attachment details. Automatically marks unread messages as read when accessed.

Instructions

Get the full content of a specific email, including the markdown body and attachment metadata. Automatically marks unread emails as read. Use the email ID from check_inbox results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
email_idYesThe email ID to read
mailbox_idNoMailbox ID (uses MULTIMAIL_MAILBOX_ID env var if not provided)

Implementation Reference

  • The handler function that executes read_email logic. It retrieves the mailbox ID, makes an API GET request to /v1/mailboxes/{id}/emails/{email_id}, and returns the full email content including markdown body and attachment metadata.
    async ({ email_id, mailbox_id }) => {
      const id = getMailboxId(mailbox_id);
      const data = await apiCall("GET", `/v1/mailboxes/${encodeURIComponent(id)}/emails/${encodeURIComponent(email_id)}`);
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
  • Input validation schema using Zod for the read_email tool. Defines email_id (required string) and mailbox_id (optional string) parameters.
      email_id: z.string().describe("The email ID to read"),
      mailbox_id: z.string().optional().describe("Mailbox ID (uses MULTIMAIL_MAILBOX_ID env var if not provided)"),
    },
  • src/index.ts:137-149 (registration)
    Tool registration using server.tool(). Registers 'read_email' with description, input schema, and handler function. The tool gets full email content and automatically marks unread emails as read.
    server.tool(
      "read_email",
      "Get the full content of a specific email, including the markdown body and attachment metadata. Automatically marks unread emails as read. Use the email ID from check_inbox results.",
      {
        email_id: z.string().describe("The email ID to read"),
        mailbox_id: z.string().optional().describe("Mailbox ID (uses MULTIMAIL_MAILBOX_ID env var if not provided)"),
      },
      async ({ email_id, mailbox_id }) => {
        const id = getMailboxId(mailbox_id);
        const data = await apiCall("GET", `/v1/mailboxes/${encodeURIComponent(id)}/emails/${encodeURIComponent(email_id)}`);
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      }
    );

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/multimail-dev/multi-mail'

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