Skip to main content
Glama
0x8687

Meme MCP Server

by 0x8687

get-emails

Retrieve emails from your inbox using search queries, label filters, and result limits to organize and access messages efficiently.

Instructions

Get emails from inbox

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxResultsNoMaximum number of emails to retrieve (default: 10)
queryNoGmail search query to filter emails
labelIdsNoArray of label IDs to filter by

Implementation Reference

  • Handler function that executes the GMAIL_GET_EMAILS action via VercelAIToolSet, formats the email list from snippets and IDs, and returns a text response with success or error message.
    }, async (args, extra) => { try { const userAddress = "default-user"; const result = await toolset.executeAction({ action: "GMAIL_GET_EMAILS", entityId: userAddress, params: args }); if (result.successful) { const emails = result.data?.response_data as any; const emailList = emails.messages?.map((email: any) => `• ${email.snippet} (${email.id})` ).join('\n') || 'No emails found'; return { content: [{ type: "text", text: `📧 Emails retrieved successfully!\n\n${emailList}\n\nTotal: ${emails.messages?.length || 0} emails` }], }; } else { return { content: [{ type: "text", text: `❌ Failed to get emails: ${result.error || 'Unknown error'}` }], }; } } catch (error) { console.error('Error getting emails:', error); return { content: [{ type: "text", text: `Error getting emails: ${error instanceof Error ? error.message : String(error)}` }], }; } });
  • Input schema using Zod for parameters: maxResults (optional number), query (optional string), labelIds (optional string array). No output schema defined; returns text content.
    maxResults: z.number().optional().describe("Maximum number of emails to retrieve (default: 10)"), query: z.string().optional().describe("Gmail search query to filter emails"), labelIds: z.array(z.string()).optional().describe("Array of label IDs to filter by"),
  • src/tools.ts:119-162 (registration)
    Registration of the 'get-emails' tool using McpServer.tool method within registerTools function, specifying name, description, input schema, and inline handler.
    server.tool("get-emails", "Get emails from inbox", { maxResults: z.number().optional().describe("Maximum number of emails to retrieve (default: 10)"), query: z.string().optional().describe("Gmail search query to filter emails"), labelIds: z.array(z.string()).optional().describe("Array of label IDs to filter by"), }, async (args, extra) => { try { const userAddress = "default-user"; const result = await toolset.executeAction({ action: "GMAIL_GET_EMAILS", entityId: userAddress, params: args }); if (result.successful) { const emails = result.data?.response_data as any; const emailList = emails.messages?.map((email: any) => `• ${email.snippet} (${email.id})` ).join('\n') || 'No emails found'; return { content: [{ type: "text", text: `📧 Emails retrieved successfully!\n\n${emailList}\n\nTotal: ${emails.messages?.length || 0} emails` }], }; } else { return { content: [{ type: "text", text: `❌ Failed to get emails: ${result.error || 'Unknown error'}` }], }; } } catch (error) { console.error('Error getting emails:', error); return { content: [{ type: "text", text: `Error getting emails: ${error instanceof Error ? error.message : String(error)}` }], }; } });

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