create-label
Generate and manage Gmail labels by specifying name, label list visibility, and message list visibility using this tool from the Meme MCP Server.
Instructions
Create a new Gmail label
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| labelListVisibility | No | Visibility of the label in the label list | |
| messageListVisibility | No | Visibility of the label in the message list | |
| name | Yes | The name of the label to create |
Implementation Reference
- src/tools.ts:407-441 (handler)The handler function that implements the core logic of the 'create-label' tool by executing the Composio 'GMAIL_CREATE_LABEL' action via the VercelAIToolSet.}, 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)}` }], }; } });
- src/tools.ts:404-406 (schema)Zod input schema for the 'create-label' tool defining parameters: name (required string), labelListVisibility and messageListVisibility (optional strings).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"),
- src/tools.ts:403-441 (registration)Registration of the 'create-label' MCP tool on the server, including schema and inline 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)}` }], }; } });