Skip to main content
Glama
0x8687

Meme MCP Server

by 0x8687

get-email

Retrieve a specific email by its ID using MCP server integration. Ideal for accessing targeted email data within the Meme MCP Server ecosystem.

Instructions

Get a specific email by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailIdYesThe ID of the email to retrieve

Implementation Reference

  • src/tools.ts:164-201 (registration)
    Full registration of the 'get-email' tool, including schema (emailId: string) and inline handler that executes Composio's GMAIL_GET_EMAIL action to retrieve and display email details.
    server.tool("get-email", "Get a specific email by ID", { emailId: z.string().describe("The ID of the email to retrieve"), }, async (args, extra) => { try { const userAddress = "default-user"; const result = await toolset.executeAction({ action: "GMAIL_GET_EMAIL", entityId: userAddress, params: args }); if (result.successful) { const email = result.data?.response_data as any; return { content: [{ type: "text", text: `📧 Email Details:\n\nFrom: ${email.payload?.headers?.find((h: any) => h.name === 'From')?.value}\nSubject: ${email.payload?.headers?.find((h: any) => h.name === 'Subject')?.value}\nDate: ${email.payload?.headers?.find((h: any) => h.name === 'Date')?.value}\n\nBody: ${email.snippet}` }], }; } else { return { content: [{ type: "text", text: `❌ Failed to get email: ${result.error || 'Unknown error'}` }], }; } } catch (error) { console.error('Error getting email:', error); return { content: [{ type: "text", text: `Error getting email: ${error instanceof Error ? error.message : String(error)}` }], }; } });
  • The handler function for 'get-email' tool. It uses VercelAIToolSet's executeAction with 'GMAIL_GET_EMAIL' to fetch the email by ID and returns formatted details including From, Subject, Date, and snippet.
    }, async (args, extra) => { try { const userAddress = "default-user"; const result = await toolset.executeAction({ action: "GMAIL_GET_EMAIL", entityId: userAddress, params: args }); if (result.successful) { const email = result.data?.response_data as any; return { content: [{ type: "text", text: `📧 Email Details:\n\nFrom: ${email.payload?.headers?.find((h: any) => h.name === 'From')?.value}\nSubject: ${email.payload?.headers?.find((h: any) => h.name === 'Subject')?.value}\nDate: ${email.payload?.headers?.find((h: any) => h.name === 'Date')?.value}\n\nBody: ${email.snippet}` }], }; } else { return { content: [{ type: "text", text: `❌ Failed to get email: ${result.error || 'Unknown error'}` }], }; } } catch (error) { console.error('Error getting email:', error); return { content: [{ type: "text", text: `Error getting email: ${error instanceof Error ? error.message : String(error)}` }], }; } });
  • Input schema for 'get-email' tool: requires 'emailId' as a string.
    server.tool("get-email", "Get a specific email by ID", { emailId: z.string().describe("The ID of the email to retrieve"),

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/0x8687/mcp-gmail-v1'

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