Skip to main content
Glama
getplatform

GetMailer MCP Server

by getplatform

get_email

Retrieve email details and delivery events by providing an email ID to track message status and content.

Instructions

Get details of a specific email including delivery events

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesEmail ID

Implementation Reference

  • Handler function for the 'get_email' tool that fetches specific email details from the GetMailer API using the provided ID and returns the result as formatted JSON text.
    case 'get_email': { const result = await apiRequest(`/api/emails/${args?.id}`); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], }; }
  • Input schema definition for the 'get_email' tool, requiring a string 'id' parameter for the email ID.
    inputSchema: { type: 'object' as const, properties: { id: { type: 'string', description: 'Email ID', }, }, required: ['id'], },
  • src/index.ts:136-149 (registration)
    Registration of the 'get_email' tool in the ListTools response, including name, description, and input schema.
    { 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'], }, },
  • Helper function 'apiRequest' used by the get_email handler to make authenticated HTTP requests to the GetMailer API.
    async function apiRequest<T>( endpoint: string, options: RequestInit = {} ): Promise<T> { const url = `${API_URL}${endpoint}`; const response = await fetch(url, { ...options, headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${API_KEY}`, ...options.headers, }, }); if (!response.ok) { let errorMessage = response.statusText; try { const errorData = await response.json(); errorMessage = errorData.error || errorData.message || errorMessage; } catch { // Ignore } throw new Error(`API Error: ${errorMessage}`); } return response.json(); }

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