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

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