Skip to main content
Glama
getplatform

GetMailer MCP Server

by getplatform

create_batch

Create batch email jobs to send personalized messages to multiple recipients using templates and variables.

Instructions

Create a batch email job to send to multiple recipients

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesBatch job name
fromYesSender email address
subjectNoEmail subject (can include {{variables}})
htmlNoHTML content (can include {{variables}})
textNoPlain text content (optional)
templateIdNoTemplate ID to use instead of html/text (optional)
recipientsYesArray of recipients with optional per-recipient variables
replyToNoReply-to address (optional)

Implementation Reference

  • The handler for the 'create_batch' tool. It sends a POST request to the GetMailer API endpoint '/api/batch' with the tool input arguments and returns the JSON response as text content.
    case 'create_batch': {
      const result = await apiRequest('/api/batch', {
        method: 'POST',
        body: JSON.stringify(args),
      });
      return {
        content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],
      };
    }
  • Input schema definition for the 'create_batch' tool, specifying the structure and requirements for batch email creation parameters.
    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'],
    },
  • src/index.ts:271-320 (registration)
    Registration of the 'create_batch' tool in the MCP server's ListTools response, including name, description, and input schema.
    {
      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'],
      },
    },

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