delete_label
Remove unwanted labels from Gmail messages to organize your inbox by deleting specific label identifiers.
Instructions
Delete a label
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the label to delete |
Implementation Reference
- src/index.ts:446-451 (handler)Handler function that executes the deletion of a Gmail label by its ID using the Gmail API.async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.labels.delete({ userId: 'me', id: params.id }) return formatResponse(data) }) }
- src/index.ts:443-445 (schema)Zod input schema for the delete_label tool, requiring the label ID as a string.{ id: z.string().describe("The ID of the label to delete") },
- src/index.ts:441-452 (registration)MCP server tool registration for 'delete_label', including description, schema, and handler.server.tool("delete_label", "Delete a label", { id: z.string().describe("The ID of the label to delete") }, async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.labels.delete({ userId: 'me', id: params.id }) return formatResponse(data) }) } )