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)}` 
                }],
            };
        }
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Get emails') but doesn't cover critical traits like whether this is a read-only operation, if it requires authentication, rate limits, pagination, or what the return format looks like. This is a significant gap for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise ('Get emails from inbox')β€”just four words. It's front-loaded and wastes no words, though it might be overly terse given the lack of behavioral context. Every word earns its place, but it could benefit from slightly more detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (3 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what 'inbox' refers to, the return format, or how results are ordered. With no annotations to fill gaps, the description should provide more context to help the agent use the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with clear documentation for all three parameters (maxResults, query, labelIds). The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline score of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get emails from inbox' clearly states the verb ('Get') and resource ('emails from inbox'), making the purpose understandable. However, it's vague about scope (e.g., which inbox, all emails vs. recent) and doesn't distinguish from siblings like 'get-email' (singular) or 'search-emails', which could cause confusion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'search-emails' or 'get-threads'. It lacks context about use cases, prerequisites, or exclusions, leaving the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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