Skip to main content
Glama
getplatform

GetMailer MCP Server

by getplatform

list_batches

View batch email jobs to monitor transactional email delivery status and manage scheduled campaigns within GetMailer.

Instructions

List batch email jobs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler implementation for the 'list_batches' tool. It fetches batch email jobs from the GetMailer API endpoint '/api/batch' and returns the JSON response as text content.
    case 'list_batches': {
      const result = await apiRequest('/api/batch');
      return {
        content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],
      };
    }
  • Tool definition in ListTools response, serving as registration and including input schema (empty properties, no required params).
    {
      name: 'list_batches',
      description: 'List batch email jobs',
      inputSchema: {
        type: 'object' as const,
        properties: {},
      },
    },
  • src/index.ts:64-344 (registration)
    The server sets the ListTools handler which registers all tools including 'list_batches'.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: 'send_email',
          description: 'Send a transactional email via GetMailer',
          inputSchema: {
            type: 'object' as const,
            properties: {
              from: {
                type: 'string',
                description: 'Sender email address (must be from a verified domain)',
              },
              to: {
                type: 'array',
                items: { type: 'string' },
                description: 'Recipient email address(es)',
              },
              subject: {
                type: 'string',
                description: 'Email subject line',
              },
              html: {
                type: 'string',
                description: 'HTML content of the email',
              },
              text: {
                type: 'string',
                description: 'Plain text content of the email',
              },
              cc: {
                type: 'array',
                items: { type: 'string' },
                description: 'CC recipients (optional)',
              },
              bcc: {
                type: 'array',
                items: { type: 'string' },
                description: 'BCC recipients (optional)',
              },
              replyTo: {
                type: 'string',
                description: 'Reply-to address (optional)',
              },
              templateId: {
                type: 'string',
                description: 'Template ID to use instead of html/text (optional)',
              },
              variables: {
                type: 'object',
                description: 'Template variables as key-value pairs (optional)',
              },
            },
            required: ['from', 'to', 'subject'],
          },
        },
        {
          name: 'list_emails',
          description: 'List sent emails with status information',
          inputSchema: {
            type: 'object' as const,
            properties: {
              limit: {
                type: 'number',
                description: 'Number of emails to return (default: 20)',
              },
              cursor: {
                type: 'string',
                description: 'Pagination cursor for next page',
              },
            },
          },
        },
        {
          name: 'get_email',
          description: 'Get details of a specific email including delivery events',
          inputSchema: {
            type: 'object' as const,
            properties: {
              id: {
                type: 'string',
                description: 'Email ID',
              },
            },
            required: ['id'],
          },
        },
        {
          name: 'list_templates',
          description: 'List available email templates',
          inputSchema: {
            type: 'object' as const,
            properties: {},
          },
        },
        {
          name: 'create_template',
          description: 'Create a new email template',
          inputSchema: {
            type: 'object' as const,
            properties: {
              name: {
                type: 'string',
                description: 'Template name',
              },
              subject: {
                type: 'string',
                description: 'Email subject (can include {{variables}})',
              },
              html: {
                type: 'string',
                description: 'HTML content (can include {{variables}})',
              },
              text: {
                type: 'string',
                description: 'Plain text content (optional)',
              },
            },
            required: ['name', 'subject', 'html'],
          },
        },
        {
          name: 'list_domains',
          description: 'List verified sending domains',
          inputSchema: {
            type: 'object' as const,
            properties: {},
          },
        },
        {
          name: 'add_domain',
          description: 'Add a new sending domain (returns DNS records to configure)',
          inputSchema: {
            type: 'object' as const,
            properties: {
              domain: {
                type: 'string',
                description: 'Domain name to add (e.g., example.com)',
              },
            },
            required: ['domain'],
          },
        },
        {
          name: 'verify_domain',
          description: 'Check if a domain has been verified',
          inputSchema: {
            type: 'object' as const,
            properties: {
              id: {
                type: 'string',
                description: 'Domain ID',
              },
            },
            required: ['id'],
          },
        },
        {
          name: 'get_analytics',
          description: 'Get email analytics and statistics',
          inputSchema: {
            type: 'object' as const,
            properties: {
              type: {
                type: 'string',
                enum: ['summary', 'daily'],
                description: 'Type of analytics (summary or daily)',
              },
              days: {
                type: 'number',
                description: 'Number of days for daily stats (default: 30)',
              },
            },
          },
        },
        {
          name: 'list_suppression',
          description: 'List suppressed email addresses (bounced, complained, or manually added)',
          inputSchema: {
            type: 'object' as const,
            properties: {
              limit: {
                type: 'number',
                description: 'Number of entries to return (default: 50)',
              },
            },
          },
        },
        {
          name: 'add_to_suppression',
          description: 'Add email addresses to the suppression list',
          inputSchema: {
            type: 'object' as const,
            properties: {
              emails: {
                type: 'array',
                items: { type: 'string' },
                description: 'Email addresses to suppress',
              },
              reason: {
                type: 'string',
                enum: ['MANUAL', 'BOUNCE', 'COMPLAINT'],
                description: 'Reason for suppression (default: MANUAL)',
              },
            },
            required: ['emails'],
          },
        },
        {
          name: 'create_batch',
          description: 'Create a batch email job to send to multiple recipients',
          inputSchema: {
            type: 'object' as const,
            properties: {
              name: {
                type: 'string',
                description: 'Batch job name',
              },
              from: {
                type: 'string',
                description: 'Sender email address',
              },
              subject: {
                type: 'string',
                description: 'Email subject (can include {{variables}})',
              },
              html: {
                type: 'string',
                description: 'HTML content (can include {{variables}})',
              },
              text: {
                type: 'string',
                description: 'Plain text content (optional)',
              },
              templateId: {
                type: 'string',
                description: 'Template ID to use instead of html/text (optional)',
              },
              recipients: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    to: { type: 'string' },
                    variables: { type: 'object' },
                  },
                  required: ['to'],
                },
                description: 'Array of recipients with optional per-recipient variables',
              },
              replyTo: {
                type: 'string',
                description: 'Reply-to address (optional)',
              },
            },
            required: ['name', 'from', 'recipients'],
          },
        },
        {
          name: 'list_batches',
          description: 'List batch email jobs',
          inputSchema: {
            type: 'object' as const,
            properties: {},
          },
        },
        {
          name: 'get_batch',
          description: 'Get batch job status and progress',
          inputSchema: {
            type: 'object' as const,
            properties: {
              id: {
                type: 'string',
                description: 'Batch ID',
              },
            },
            required: ['id'],
          },
        },
      ],
    }));
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'List batch email jobs' implies a read-only operation but doesn't specify whether it returns all batches, supports pagination, includes metadata (e.g., status, dates), or has rate limits. For a list tool with zero annotation coverage, this is a significant gap in transparency about how the tool behaves.

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, efficient sentence ('List batch email jobs') with zero wasted words. It is front-loaded and directly states the core functionality without unnecessary elaboration. This is appropriately sized for a simple list tool with no parameters.

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

Completeness3/5

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

Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is minimally complete. It states what the tool does but lacks behavioral details (e.g., return format, pagination) that would be helpful for an agent. Without annotations or output schema, the description should ideally provide more context about the listing behavior, but it's adequate for basic understanding.

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?

The input schema has 0 parameters with 100% coverage, so the schema fully documents the lack of inputs. The description doesn't add parameter details, which is appropriate since there are none. Baseline is 4 for 0 parameters, as no compensation is needed, and the description correctly implies no filtering or options are required.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List batch email jobs' clearly states the verb ('List') and resource ('batch email jobs'), making the purpose immediately understandable. It distinguishes from siblings like 'get_batch' (which likely retrieves a single batch) and 'create_batch' (which creates one), though it doesn't explicitly differentiate them. The purpose is specific but lacks explicit sibling comparison.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context (e.g., after creating batches), or exclusions (e.g., not for filtering or analytics). With siblings like 'get_batch' for single batches and 'get_analytics' for performance data, the lack of usage guidelines leaves the agent to infer based on tool names alone.

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/getplatform/getmailer-mcp'

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