Skip to main content
Glama
lobster-kit

mcp-server-lobstermail

by lobster-kit

Search Emails

search_emails

Search emails across inboxes by keyword, filtering by sender, date, attachments, or direction to find specific messages.

Instructions

Search emails across all inboxes by keyword. Matches against subject, sender address, and body preview. Optionally scope to a single inbox or filter by sender, direction, date, or attachments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (e.g. "invoice", "verification code")
inbox_idNoScope search to a specific inbox ID
fromNoFilter by sender address (partial match)
directionNoFilter by email direction
sinceNoOnly emails after this ISO 8601 date
untilNoOnly emails before this ISO 8601 date
has_attachmentsNoFilter by attachment presence
limitNoMax results (1-50, default 20)

Implementation Reference

  • The handler function that executes the search_emails tool by calling the LobsterMail client's searchEmails method.
    }, async ({ query, inbox_id, from, direction, since, until, has_attachments, limit }) => {
      const lm = await getClient();
      const results = await lm.searchEmails({
        q: query,
        inboxId: inbox_id,
        from,
        direction,
        since,
        until,
        hasAttachments: has_attachments,
        limit,
      });
    
      if (results.data.length === 0) {
        return {
          content: [{ type: 'text' as const, text: `No emails found matching "${query}".` }],
  • src/index.ts:226-241 (registration)
    Registration and schema definition for the search_emails tool.
    server.registerTool('search_emails', {
      title: 'Search Emails',
      description:
        'Search emails across all inboxes by keyword. ' +
        'Matches against subject, sender address, and body preview. ' +
        'Optionally scope to a single inbox or filter by sender, direction, date, or attachments.',
      inputSchema: {
        query: z.string().describe('Search query (e.g. "invoice", "verification code")'),
        inbox_id: z.string().optional().describe('Scope search to a specific inbox ID'),
        from: z.string().optional().describe('Filter by sender address (partial match)'),
        direction: z.enum(['inbound', 'outbound']).optional().describe('Filter by email direction'),
        since: z.string().optional().describe('Only emails after this ISO 8601 date'),
        until: z.string().optional().describe('Only emails before this ISO 8601 date'),
        has_attachments: z.boolean().optional().describe('Filter by attachment presence'),
        limit: z.number().optional().describe('Max results (1-50, default 20)'),
      },
Behavior4/5

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

Strong addition of search scope semantics: specifies that keyword matches against 'subject, sender address, and body preview'—critical behavioral detail not present in the schema. Lacks annotations and omits result ordering/pagination behavior details (beyond the limit parameter).

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?

Two tightly constructed sentences. Front-loaded with core functionality (search across all inboxes), followed by optional capabilities. No redundant text.

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 high schema coverage and the tool's straightforward search purpose, the description adequately covers matching behavior and filtering. Minor gap: no mention of result structure or ordering in the absence of annotations or 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?

With 100% schema description coverage, the schema carries the full documentation burden. The description maps parameters to concepts ('scope', 'filter by') but adds no syntax details or format constraints beyond what the schema already provides.

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?

Excellent clarity: specifies verb (search), resource (emails), default scope (across all inboxes), and distinguishes from sibling `get_email` (single retrieval) by emphasizing keyword matching across multiple fields.

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?

Provides implied usage through filtering options ('Optionally scope to a single inbox'), but lacks explicit guidance on when to use `get_email` or `list_threads` instead, or when searching is preferable to direct fetching.

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