Skip to main content
Glama
lobster-kit

mcp-server-lobstermail

by lobster-kit

wait_for_email

Monitor an inbox for incoming emails using real-time server-side polling. Returns matching emails in LLM-safe format when they arrive, with optional filters for sender, subject, and timeout.

Instructions

Wait for an incoming email matching optional filters. Returns near-instantly when an email arrives (real-time server-side long-polling). Returns the email body in LLM-safe format.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inbox_idYesInbox ID (e.g. ibx_...)
fromNoFilter by sender address
subjectNoFilter by subject (substring match)
timeoutNoMax wait time in milliseconds (default: 60000, max: 120000)

Implementation Reference

  • The tool handler for wait_for_email, which calls inbox.waitForEmail.
    }, async ({ inbox_id, from, subject, timeout }) => {
      const inbox = await getInbox(inbox_id);
      const effectiveTimeout = Math.min(timeout ?? 60_000, 120_000);
    
      const email = await inbox.waitForEmail({
        filter: { from, subject },
        timeout: effectiveTimeout,
      });
  • src/index.ts:98-113 (registration)
    The registration of the wait_for_email tool, including its schema and metadata.
    server.registerTool('wait_for_email', {
      title: 'Wait for Email',
      description:
        'Wait for an incoming email matching optional filters. ' +
        'Returns near-instantly when an email arrives (real-time server-side long-polling). ' +
        'Returns the email body in LLM-safe format.',
      inputSchema: {
        inbox_id: z.string().describe('Inbox ID (e.g. ibx_...)'),
        from: z.string().optional().describe('Filter by sender address'),
        subject: z.string().optional().describe('Filter by subject (substring match)'),
        timeout: z
          .number()
          .optional()
          .describe('Max wait time in milliseconds (default: 60000, max: 120000)'),
      },
    }, async ({ inbox_id, from, subject, timeout }) => {

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/lobster-kit/mcp-server-lobstermail'

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