Skip to main content
Glama

read_email

Retrieve the content of a specific email using its message ID. Optionally specify an inbox ID to narrow the search.

Instructions

Read a specific email message. If inbox_id is omitted, uses the default inbox.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inbox_idNoInbox ID (optional, uses default inbox)
message_idYesMessage ID

Implementation Reference

  • The handler function that executes the read_email tool logic: resolves the inbox (default if omitted), then calls the API GET endpoint to fetch a specific email message by message_id.
    async ({ inbox_id, message_id }) => {
      if (!inbox_id) {
        const inbox = await getOrCreateDefaultInbox();
        if (inbox.error) return { content: [{ type: 'text', text: JSON.stringify(inbox, null, 2) }] };
        inbox_id = inboxId(inbox);
      }
      const result = await api('GET', `/v1/inboxes/${inbox_id}/messages/${message_id}`);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • mcp/index.js:222-238 (registration)
    Registration of the 'read_email' tool on the MCP server via server.tool(), including its description and parameter schema.
    server.tool(
      'read_email',
      'Read a specific email message. If inbox_id is omitted, uses the default inbox.',
      {
        inbox_id: idSchema.optional().describe('Inbox ID (optional, uses default inbox)'),
        message_id: idSchema.describe('Message ID')
      },
      async ({ inbox_id, message_id }) => {
        if (!inbox_id) {
          const inbox = await getOrCreateDefaultInbox();
          if (inbox.error) return { content: [{ type: 'text', text: JSON.stringify(inbox, null, 2) }] };
          inbox_id = inboxId(inbox);
        }
        const result = await api('GET', `/v1/inboxes/${inbox_id}/messages/${message_id}`);
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
      }
    );
  • The idSchema used for inbox_id and message_id parameters in read_email. Accepts numbers or numeric strings.
    const idSchema = z.union([
      z.number(),
      z.string().transform((v) => {
        const n = Number(v);
        if (isNaN(n)) throw new Error(`Invalid ID: ${v}`);
        return n;
      })
    ]).describe('ID (number or numeric string)');
  • Helper function used by the read_email handler to extract the inbox ID from an inbox object.
    function inboxId(inbox) {
      return inbox?.id || inbox?.inbox_id;
    }
  • Helper function used by the read_email handler to get or prompt creation of a default inbox when inbox_id is not provided.
    async function getOrCreateDefaultInbox() {
      const inbox = await getDefaultInbox();
      if (inbox) return inbox;
      if (inbox?.error) return inbox;
      return {
        error: 'NO_INBOX',
        message: 'You don\'t have an email inbox yet! Let\'s set one up first.',
        action: 'Ask the user what name they want for their email address, then call my_email(preferred_name: "theirname") to create it. For example: jarvis@clawaimail.com, assistant@clawaimail.com, etc.',
        hint: 'The user can choose any name — if it\'s taken, a similar alternative will be suggested.'
      };
    }
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. However, it only states the basic action without mentioning side effects, permissions, or error handling. The absence of such context limits transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that front-loads the core purpose. No extraneous information is included, making it efficient for an agent to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read operation, the description covers the basic purpose and parameter hints. However, it lacks details on return values, error behavior, or whether the email is marked as read, which would be helpful given no output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already describes both parameters (inbox_id and message_id) with 100% coverage. The description adds no new semantic meaning beyond restating the default inbox behavior, so it provides minimal additional value.

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 'Read a specific email message', clearly defining the action and resource. It differentiates from sibling tools like list_messages or search_emails by focusing on a single message retrieval.

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

Usage Guidelines3/5

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

The description provides a usage hint about omitting inbox_id to use the default inbox, but does not specify when to use this tool vs alternatives like search_emails or list_messages. No exclusions or explicit context are given.

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/joansongjr/clawaimail'

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