Skip to main content
Glama

delete_label

Remove unwanted labels from your Gmail account to maintain an organized inbox by specifying the label ID to delete.

Instructions

Delete a Gmail label

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelIdYesLabel ID to delete

Implementation Reference

  • The core handler function that executes the deletion of the specified Gmail label using the Google Gmail API.
    async deleteLabel(id: string): Promise<void> { await this.gmail.users.labels.delete({ userId: 'me', id }); }
  • The tool-specific dispatch handler within handleToolCall that validates the input and calls the GmailService deleteLabel method.
    case "delete_label": { const v = validated as z.infer<typeof schemas.delete_label>; await gmailService.deleteLabel(v.labelId); return { content: [{ type: "text", text: `Label ${v.labelId} deleted successfully.` }] }; }
  • Zod input schema definition for the delete_label tool, specifying the required labelId parameter.
    delete_label: z.object({ labelId: z.string().describe("Label ID to delete") }),
  • src/tools.ts:50-55 (registration)
    Registers the delete_label tool (among others) by providing its name, description, and input schema for MCP tool discovery.
    export const getToolDefinitions = () => Object.entries(schemas).map(([name, schema]) => ({ name, description: toolDescriptions[name], inputSchema: zodToJsonSchema(schema) }));
  • Tool description used in registration for the delete_label tool.
    delete_label: "Delete a Gmail label",

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/muammar-yacoob/GMail-Manager-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server