Skip to main content
Glama
0x8687

Meme MCP Server

by 0x8687

get-labels

Retrieve all Gmail labels to organize and categorize email data for meme creation workflows.

Instructions

Get all Gmail labels

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Inline handler for the 'get-labels' MCP tool. Retrieves all Gmail labels by executing the Composio 'GMAIL_GET_LABELS' action via VercelAIToolSet, formats the list, and returns a text response.
    server.tool("get-labels", "Get all Gmail labels", {}, async (args, extra) => {
        try {
            const userAddress = "default-user";
            
            const result = await toolset.executeAction({
                action: "GMAIL_GET_LABELS",
                entityId: userAddress,
                params: {}
            });
            
            if (result.successful) {
                const labels = result.data?.response_data as any;
                const labelList = labels.labels?.map((label: any) => 
                    `• ${label.name} (${label.id})`
                ).join('\n') || 'No labels found';
                
                return {
                    content: [{ 
                        type: "text", 
                        text: `🏷️ Labels retrieved successfully!\n\n${labelList}\n\nTotal: ${labels.labels?.length || 0} labels` 
                    }],
                };
            } else {
                return {
                    content: [{ 
                        type: "text", 
                        text: `❌ Failed to get labels: ${result.error || 'Unknown error'}` 
                    }],
                };
            }
        } catch (error) {
            console.error('Error getting labels:', error);
            return {
                content: [{ 
                    type: "text", 
                    text: `Error getting labels: ${error instanceof Error ? error.message : String(error)}` 
                }],
            };
        }
    });
  • src/tools.ts:362-401 (registration)
    Registers the 'get-labels' tool with MCP server using server.tool(), including empty schema {} and inline handler.
    server.tool("get-labels", "Get all Gmail labels", {}, async (args, extra) => {
        try {
            const userAddress = "default-user";
            
            const result = await toolset.executeAction({
                action: "GMAIL_GET_LABELS",
                entityId: userAddress,
                params: {}
            });
            
            if (result.successful) {
                const labels = result.data?.response_data as any;
                const labelList = labels.labels?.map((label: any) => 
                    `• ${label.name} (${label.id})`
                ).join('\n') || 'No labels found';
                
                return {
                    content: [{ 
                        type: "text", 
                        text: `🏷️ Labels retrieved successfully!\n\n${labelList}\n\nTotal: ${labels.labels?.length || 0} labels` 
                    }],
                };
            } else {
                return {
                    content: [{ 
                        type: "text", 
                        text: `❌ Failed to get labels: ${result.error || 'Unknown error'}` 
                    }],
                };
            }
        } catch (error) {
            console.error('Error getting labels:', error);
            return {
                content: [{ 
                    type: "text", 
                    text: `Error getting labels: ${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 full burden for behavioral disclosure. 'Get all Gmail labels' implies a read-only operation but doesn't specify whether it requires authentication, returns paginated results, includes system vs. user labels, or handles errors. For a tool with zero annotation coverage, this leaves significant behavioral gaps unaddressed.

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

Conciseness5/5

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

The description is a single, efficient sentence ('Get all Gmail labels') that front-loads the core purpose without unnecessary words. Every word earns its place: 'Get' specifies the action, 'all' clarifies scope, 'Gmail' defines the domain, and 'labels' identifies the resource. No structural issues or redundancy exist.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks context about authentication needs, return format, or error handling. For a read operation in a Gmail context, more guidance would be helpful, but the description meets basic requirements for such a straightforward tool.

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

Parameters4/5

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

The input schema has 0 parameters with 100% description coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing instead on the tool's purpose. This meets the baseline for tools with no parameters, as there's nothing to compensate for.

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

Purpose4/5

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

The description 'Get all Gmail labels' clearly states the verb ('Get') and resource ('Gmail labels'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'create-label' or 'get-gmail-settings', but the specificity of 'labels' provides inherent distinction. The description avoids tautology with the tool name 'get-labels' by adding the resource domain ('Gmail').

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. It doesn't mention prerequisites (e.g., needing Gmail connection), compare to similar tools like 'get-gmail-settings' or 'create-label', or indicate use cases (e.g., for listing available labels before filtering emails). The agent must infer usage from the tool name and context 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