todoist_delete_label
Remove a Todoist label by specifying its ID, enabling efficient label management within the Enhanced Todoist MCP Server Extended.
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)Executes the deletion of a Todoist label by calling todoistClient.deleteLabel with the provided labelId after argument validation.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)Defines the tool metadata, description, and input schema 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:1108-1114 (registration)Registers the todoist_delete_label tool (DELETE_LABEL_TOOL) in the list of tools advertised via the ListToolsRequestHandler.// Label tools CREATE_LABEL_TOOL, GET_LABEL_TOOL, GET_LABELS_TOOL, UPDATE_LABEL_TOOL, DELETE_LABEL_TOOL, // Comment tools
- src/index.ts:982-992 (helper)Type guard helper function that validates if the arguments object contains a valid string labelId, used in label tool handlers.function isLabelIdArgs(args: unknown): args is { labelId: string; } { return ( typeof args === "object" && args !== null && "labelId" in args && typeof (args as { labelId: string }).labelId === "string" ); }