Skip to main content
Glama
lobster-kit

mcp-server-lobstermail

by lobster-kit

Wait for Email

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 }) => {
Behavior4/5

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

No annotations provided, so description carries full burden. Discloses critical behavioral details: real-time server-side long-polling mechanism, blocking/until-arrival semantics, and LLM-safe output format. Missing timeout failure mode disclosure.

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?

Three sentences, each earning its place: purpose declaration, timing/mechanism disclosure, output format specification. Front-loaded with verb, zero redundancy.

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

Completeness4/5

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

Given 4 parameters (1 required), no annotations, and no output schema, description adequately covers tool behavior including return format and polling mechanism. Would benefit from noting timeout expiration behavior.

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%, establishing baseline 3. Description adds value by semantically grouping 'from' and 'subject' as 'optional filters', helping agent understand their joint purpose. Could mention inbox_id as target container.

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?

Specific verb 'Wait' + resource 'incoming email' clearly distinguishes this from siblings like get_email, check_inbox, or search_emails which operate on existing emails. 'Matching optional filters' adds scope clarity.

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

Usage Guidelines4/5

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

Clear context that this blocks until an email arrives ('Wait for', 'Returns near-instantly when'), distinguishing it from synchronous retrieval siblings. Lacks explicit 'when not to use' but the blocking behavior description provides clear usage context.

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

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