Skip to main content
Glama

delete_labels

Remove personal labels from Todoist tasks by specifying label IDs or names to clean up your task organization system.

Instructions

Delete a personal label in Todoist Either 'id' or the 'name' to identify the target.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes

Implementation Reference

  • Registers the delete_labels MCP tool with batch API handler factory, defining schema, path, method, and name lookup logic.
    createBatchApiHandler({
        name: 'delete_labels',
        description: 'Delete a personal label in Todoist',
        itemSchema: {
            id: z.string().optional().describe('ID of the label to delete (preferred over name)'),
            name: z.string().optional().describe('Name of the label to delete'),
        },
        method: 'DELETE',
        path: '/labels/{id}',
        idField: 'id',
        nameField: 'name',
        mode: 'delete',
        findByName: (name, items) =>
            items.find(item => item.name.toLowerCase().includes(name.toLowerCase())),
    });
  • Zod schema for input items: array of objects with optional 'id' or 'name' for the label to delete.
    itemSchema: {
        id: z.string().optional().describe('ID of the label to delete (preferred over name)'),
        name: z.string().optional().describe('Name of the label to delete'),
    },
  • Executes the DELETE request to Todoist API at constructed path (e.g., /labels/{id}) within the batch handler for delete_labels.
    switch (options.method) {
        case 'GET':
            result = await todoistApi.get(finalPath, apiParams);
            break;
        case 'POST':
            result = await todoistApi.post(finalPath, apiParams);
            break;
        case 'DELETE':
            result = await todoistApi.delete(finalPath);
            break;
    }
  • Fetches list of all labels (/labels) if name lookup needed (derives path from tool's path '/labels/{id}') for delete_labels.
    if (needsNameLookup) {
        // Determine the base path for fetching all items
        // Example: /tasks from /tasks/{id}
        const lookupPath =
            options.basePath || (options.path ? options.path.split('/{')[0] : '');
        allItems = await todoistApi.get(lookupPath, {});
    }
  • Name-to-ID resolution logic using tool-provided findByName on fetched labels list for delete_labels.
    if (!itemId && item[options.nameField!] && options.findByName) {
        const searchName = item[options.nameField!];
        const matchedItem = options.findByName(searchName, allItems);
    
        if (!matchedItem) {
            return {
                success: false,
                error: `Item not found with name: ${searchName}`,
                item,
            };
        }
    
        itemId = matchedItem.id;
        matchedName = searchName;
        matchedContent = matchedItem.content;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool deletes personal labels and identifies targets via 'id' or 'name', but fails to disclose critical traits: whether deletion is permanent/reversible, if it affects associated tasks, required permissions, rate limits, or error handling. For a destructive operation, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with two sentences that are front-loaded and waste no words. Every part contributes directly to understanding the tool's purpose and identification method, making it efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's destructive nature, lack of annotations, 0% schema coverage, and no output schema, the description is incomplete. It doesn't cover behavioral aspects (permanence, side effects), parameter details beyond basic identification, or return values, leaving the agent with inadequate context for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds minimal semantics by mentioning 'id' or 'name' to identify targets, but doesn't explain the 'items' array structure, that multiple labels can be deleted at once, or the preference for 'id' over 'name' (implied but not explicit). This is insufficient for a 1-parameter tool with complex nested objects.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and resource ('a personal label in Todoist'), which is specific and unambiguous. It distinguishes the tool by specifying it's for personal labels (not shared labels), though it doesn't explicitly differentiate from sibling tools like 'delete_tasks' or 'delete_projects' beyond the resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'update_labels' or 'delete_shared_labels', nor does it mention prerequisites (e.g., needing label existence or permissions). It only states how to identify the target, not when this operation is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/stanislavlysenko0912/todoist-mcp-server'

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