todoist_delete_label
Remove a label from your Todoist workspace by specifying its ID to clean up your task organization system.
Instructions
Delete a label by its ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| labelId | Yes | The ID of the label to delete. |
Implementation Reference
- src/index.ts:1606-1619 (handler)Handler that checks arguments with isLabelIdArgs, calls todoistClient.deleteLabel on the provided labelId, and returns success or error message.if (name === "todoist_delete_label") { if (!isLabelIdArgs(args)) { return { content: [{ type: "text", text: "Invalid arguments for delete_label" }], isError: true }; } try { await todoistClient.deleteLabel(args.labelId); return { content: [{ type: "text", text: `Label ${args.labelId} deleted.` }], isError: false }; } catch (error: any) { return { content: [{ type: "text", text: `Error deleting label: ${error.message}` }], isError: true }; } }
- src/index.ts:351-361 (schema)Tool schema defining the inputSchema requiring a labelId string.const DELETE_LABEL_TOOL: Tool = { name: "todoist_delete_label", description: "Delete a label by its ID.", inputSchema: { type: "object", properties: { labelId: { type: "string", description: "The ID of the label to delete." } }, required: ["labelId"] } };
- src/index.ts:1113-1113 (registration)The tool is registered by inclusion in the tools array returned by the ListToolsRequestSchema handler.DELETE_LABEL_TOOL,
- src/index.ts:982-991 (helper)Type guard helper function used to validate arguments for label tools like todoist_delete_label.function isLabelIdArgs(args: unknown): args is { labelId: string; } { return ( typeof args === "object" && args !== null && "labelId" in args && typeof (args as { labelId: string }).labelId === "string" ); }