Skip to main content
Glama
bcharleson

Instantly MCP Server

get_email

Retrieve a specific email by its unique ID to access and review email content or campaign details from the Instantly API.

Instructions

Get a specific email by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
email_idYesEmail ID/UUID

Implementation Reference

  • Main handler logic for 'get_email' tool: validates email_id parameter, calls Instantly API endpoint `/emails/{email_id}` to fetch email details, formats and returns the response.
    case 'get_email': {
      console.error('[Instantly MCP] 📧 Executing get_email...');
    
      if (!args.email_id) {
        throw new McpError(ErrorCode.InvalidParams, 'Email ID is required for get_email');
      }
    
      const emailResult = await makeInstantlyRequest(`/emails/${args.email_id}`, {}, apiKey);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              email: emailResult,
              message: 'Email retrieved successfully'
            }, null, 2)
          }
        ]
      };
    }
  • Zod schema for validating 'get_email' input parameters (requires email_id string).
    export const GetEmailSchema = z.object({
      email_id: z.string().min(1, { message: 'Email ID cannot be empty' })
    });
  • Tool registration/definition including name, description, annotations, and input schema for the MCP tools list.
    {
      name: 'get_email',
      title: 'Get Email',
      description: 'Get email details by ID',
      annotations: { readOnlyHint: true },
      inputSchema: {
        type: 'object',
        properties: {
          email_id: { type: 'string', description: 'Email UUID' }
        },
        required: ['email_id']
      }
    },
  • Central tools registry that includes emailTools (containing get_email) via aggregation from category files.
    export const TOOLS_DEFINITION = buildToolsDefinition();
  • Validation function for get_email parameters using the GetEmailSchema.
    export function validateGetEmailData(args: unknown): z.infer<typeof GetEmailSchema> {
      return validateWithSchema(GetEmailSchema, args, 'get_email');
    }

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/bcharleson/Instantly-MCP'

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