Skip to main content
Glama

delete_label

Remove a label from your Gmail account to organize your inbox by deleting unnecessary or outdated labels.

Instructions

Delete a Gmail label

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelIdYesLabel ID to delete

Implementation Reference

  • The handler case within handleToolCall function that processes the 'delete_label' tool call, validates the input using Zod schema, calls gmailService.deleteLabel, and returns a success message.
    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 schema definition for the 'delete_label' tool input, specifying labelId as a required string.
    delete_label: z.object({ labelId: z.string().describe("Label ID to delete") }),
  • src/tools.ts:50-55 (registration)
    Registration of all tools including 'delete_label' via getToolDefinitions, which generates JSON schemas from Zod schemas and includes descriptions for MCP tool discovery.
    export const getToolDefinitions = () => Object.entries(schemas).map(([name, schema]) => ({ name, description: toolDescriptions[name], inputSchema: zodToJsonSchema(schema) }));
  • The GmailService method that implements the core logic to delete a Gmail label using the Google Gmail API.
    async deleteLabel(id: string): Promise<void> { await this.gmail.users.labels.delete({ userId: 'me', id }); }

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