delete_label
Deletes a specified label from a WhatsApp session using session ID and label ID.
Instructions
Delete a label from the WhatsApp session
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | Session ID | |
| labelId | Yes | Label ID to delete |
Implementation Reference
- src/tools/labels.ts:49-56 (handler)Handler function that executes the delete_label logic: sends a DELETE request to /sessions/{sessionId}/labels/{labelId} via openwaClient.
async ({ sessionId, labelId }) => { const data = await openwaClient({ method: "DELETE", path: `/sessions/${sessionId}/labels/${labelId}`, }); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } ); - src/tools/labels.ts:42-48 (schema)Schema definition for delete_label: requires sessionId (string) and labelId (string).
{ description: "Delete a label from the WhatsApp session", inputSchema: { sessionId: z.string().describe("Session ID"), labelId: z.string().describe("Label ID to delete"), }, }, - src/tools/labels.ts:40-56 (registration)Registration of the delete_label tool using server.registerTool, within the registerLabelTools function.
server.registerTool( "delete_label", { description: "Delete a label from the WhatsApp session", inputSchema: { sessionId: z.string().describe("Session ID"), labelId: z.string().describe("Label ID to delete"), }, }, async ({ sessionId, labelId }) => { const data = await openwaClient({ method: "DELETE", path: `/sessions/${sessionId}/labels/${labelId}`, }); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } );