Skip to main content
Glama
MrNewDelhi

Mailosaur MCP

by MrNewDelhi

mailosaur_messages_get

Retrieves the first matching email or SMS message from a Mailosaur server, waiting briefly if needed. Ideal for automated testing to confirm receipt of expected messages.

Instructions

Wait for and return the first full message matching criteria. Best for test flows where an email/SMS may arrive shortly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverYesMailosaur server ID.
criteriaYes
optionsNo

Implementation Reference

  • src/index.ts:120-134 (registration)
    Registration of the 'mailosaur_messages_get' tool via server.tool(), defining its name, description, schema, and handler.
    server.tool(
      "mailosaur_messages_get",
      "Wait for and return the first full message matching criteria. Best for test flows where an email/SMS may arrive shortly.",
      {
        server: z.string().describe("Mailosaur server ID."),
        criteria: SearchCriteriaSchema,
        options: MessageWaitOptionsSchema.optional()
      },
      async ({ server, criteria, options }) => {
        const searchOptions = toSearchOptions(options);
        const { errorOnTimeout: _errorOnTimeout, ...getOptions } = searchOptions ?? {};
        const message = await mailosaur.messages.get(server, criteria, getOptions);
        return response(message);
      }
    );
  • Handler function that receives server, criteria, and options, calls mailosaur.messages.get(), and returns the response.
    async ({ server, criteria, options }) => {
      const searchOptions = toSearchOptions(options);
      const { errorOnTimeout: _errorOnTimeout, ...getOptions } = searchOptions ?? {};
      const message = await mailosaur.messages.get(server, criteria, getOptions);
      return response(message);
    }
  • Input schema for the tool: server (string), criteria (SearchCriteriaSchema), and optional options (MessageWaitOptionsSchema).
    {
      server: z.string().describe("Mailosaur server ID."),
      criteria: SearchCriteriaSchema,
      options: MessageWaitOptionsSchema.optional()
    },
  • Definition of MessageWaitOptionsSchema used by the tool's options parameter.
    const MessageWaitOptionsSchema = MessageListOptionsSchema.extend({
      timeout: z.number().int().min(1).optional(),
      errorOnTimeout: z.boolean().optional()
    });
  • Definition of SearchCriteriaSchema used by the tool's criteria parameter.
    const SearchCriteriaSchema = z.object({
      sentFrom: z.string().optional(),
      sentTo: z.string().optional(),
      subject: z.string().optional(),
      body: z.string().optional(),
      match: z.enum(["ALL", "ANY"]).optional()
    });
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the waiting behavior (polling) and that it returns a 'full message,' which is useful. However, it does not mention potential side effects, rate limits, or what happens if no message arrives, leaving gaps in 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, front-loaded sentence that conveys the core purpose efficiently without unnecessary words. Every part earns its place.

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

Completeness2/5

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

Given the absence of an output schema and the presence of complex nested parameters (criteria and options), the description fails to explain what the 'full message' return value looks like or how the parameters interact. This leaves significant gaps for an agent to invoke the tool correctly.

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

Parameters2/5

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

Schema description coverage is only 33% (only 'server' has a brief description). The tool description adds no additional parameter details beyond the schema, failing to explain the meanings or usage of 'criteria' subfields or 'options' like 'timeout' and 'errorOnTimeout'. This is insufficient for proper agent invocation.

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 clearly states the action: 'Wait for and return the first full message matching criteria.' It specifies the resource ('first full message') and the verb ('wait for and return'), and distinguishes it from sibling tools like list or search by emphasizing the waiting behavior for test flows.

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?

The description provides context by stating it is 'best for test flows where an email/SMS may arrive shortly,' implying immediate use when expecting a message. However, it does not explicitly state when not to use it or mention alternatives, though sibling tools are available for non-waiting retrieval.

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/MrNewDelhi/mailosaur-mcp'

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