Skip to main content
Glama
0x8687

Meme MCP Server

by 0x8687

create-label

Create a new Gmail label to organize emails, with options to control visibility in label and message lists.

Instructions

Create a new Gmail label

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the label to create
labelListVisibilityNoVisibility of the label in the label list
messageListVisibilityNoVisibility of the label in the message list

Implementation Reference

  • The handler function that implements the core logic for the 'create-label' tool. It uses the Composio toolset to execute the 'GMAIL_CREATE_LABEL' action with the provided arguments.
    }, async (args, extra) => {
        try {
            const userAddress = "default-user";
            
            const result = await toolset.executeAction({
                action: "GMAIL_CREATE_LABEL",
                entityId: userAddress,
                params: args
            });
            
            if (result.successful) {
                return {
                    content: [{ 
                        type: "text", 
                        text: `✅ Label created successfully!\n\nLabel: ${args.name}\nID: ${(result.data?.response_data as any)?.id}` 
                    }],
                };
            } else {
                return {
                    content: [{ 
                        type: "text", 
                        text: `❌ Failed to create label: ${result.error || 'Unknown error'}` 
                    }],
                };
            }
        } catch (error) {
            console.error('Error creating label:', error);
            return {
                content: [{ 
                    type: "text", 
                    text: `Error creating label: ${error instanceof Error ? error.message : String(error)}` 
                }],
            };
        }
    });
  • Zod schema defining the input parameters for the 'create-label' tool: required 'name' and optional visibility fields.
        name: z.string().describe("The name of the label to create"),
        labelListVisibility: z.string().optional().describe("Visibility of the label in the label list"),
        messageListVisibility: z.string().optional().describe("Visibility of the label in the message list"),
    }, async (args, extra) => {
  • src/tools.ts:403-441 (registration)
    The server.tool registration call that registers the 'create-label' tool with its schema and handler.
    server.tool("create-label", "Create a new Gmail label", {
        name: z.string().describe("The name of the label to create"),
        labelListVisibility: z.string().optional().describe("Visibility of the label in the label list"),
        messageListVisibility: z.string().optional().describe("Visibility of the label in the message list"),
    }, async (args, extra) => {
        try {
            const userAddress = "default-user";
            
            const result = await toolset.executeAction({
                action: "GMAIL_CREATE_LABEL",
                entityId: userAddress,
                params: args
            });
            
            if (result.successful) {
                return {
                    content: [{ 
                        type: "text", 
                        text: `✅ Label created successfully!\n\nLabel: ${args.name}\nID: ${(result.data?.response_data as any)?.id}` 
                    }],
                };
            } else {
                return {
                    content: [{ 
                        type: "text", 
                        text: `❌ Failed to create label: ${result.error || 'Unknown error'}` 
                    }],
                };
            }
        } catch (error) {
            console.error('Error creating label:', error);
            return {
                content: [{ 
                    type: "text", 
                    text: `Error creating label: ${error instanceof Error ? error.message : String(error)}` 
                }],
            };
        }
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but only states the basic action. It doesn't mention whether this requires specific permissions, what happens on duplicate label names, whether labels are user-specific or global, or any rate limits. For a mutation tool with zero annotation coverage, this is insufficient.

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 that states the core purpose without any wasted words. It's appropriately sized for a simple tool and front-loads the essential information.

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?

For a mutation tool with no annotations and no output schema, the description is inadequate. It doesn't explain what happens on success (e.g., returns label ID), error conditions, authentication requirements, or how it fits within the broader Gmail context. The agent would have significant gaps in understanding how to use this 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?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no additional parameter information beyond the basic purpose. This meets the baseline of 3 since the schema does the heavy lifting, but the description doesn't compensate with any extra context about parameter usage.

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 clearly states the verb 'Create' and the resource 'new Gmail label', making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get-labels' or explain what distinguishes label creation from other Gmail operations, preventing a perfect score.

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 (like needing authentication), when label creation is appropriate versus using existing labels, or how it relates to sibling tools like 'get-labels' for checking existing labels first.

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