Skip to main content
Glama
lobster-kit

mcp-server-lobstermail

by lobster-kit

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)'),
      },

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