Skip to main content
Glama
kydycode

Enhanced Todoist MCP Server Extended

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
NameRequiredDescriptionDefault
labelIdYesThe ID of the label to delete.

Implementation Reference

  • 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 };
      }
    }
  • 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,
  • 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"
      );
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kydycode/todoist-mcp-server-ext'

If you have feedback or need assistance with the MCP directory API, please join our Discord server