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
| Name | Required | Description | Default |
|---|---|---|---|
| labelId | Yes | Label ID to delete |
Implementation Reference
- src/gmail-service.ts:93-95 (handler)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 }); }
- src/tools.ts:108-112 (handler)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.` }] }; }
- src/tools.ts:15-15 (schema)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) }));
- src/tools.ts:42-42 (schema)Tool description used in registration for the delete_label tool.delete_label: "Delete a Gmail label",