delete_label
Remove a Gmail label by providing its ID. Simplifies label management by deleting unwanted labels from your account.
Instructions
Delete a label
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the label to delete |
Implementation Reference
- src/index.ts:455-466 (registration)Registration of the 'delete_label' tool via server.tool(), defining its 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) }) } ) - src/index.ts:456-459 (schema)Input schema for delete_label: requires 'id' as a string describing the label ID to delete.
"Delete a label", { id: z.string().describe("The ID of the label to delete") }, - src/index.ts:460-465 (handler)Handler function for delete_label: calls gmail.users.labels.delete with userId 'me' and the provided label id, then formats the response.
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) }) }