Skip to main content
Glama
guifelix

MCP Todo.txt Integration

remove-metadata

Remove specific metadata keys from a Todo.txt task by ID to clean up task entries and maintain organized task lists.

Instructions

Remove specific metadata keys from a task by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYes
keysYes

Implementation Reference

  • Handler function that loads tasks, finds the task by ID, removes the specified metadata keys using removeExtension, saves tasks, and returns success or error.
    async ({ taskId, keys }) => {
        const tasks = await loadTasks();
        const idx = getTaskIndex(taskId, tasks);
        if (idx === null) {
            return {
                content: [
                    { type: "text", text: "Invalid task ID." },
                ],
                isError: true,
            };
        }
        keys.forEach((key: string) => {
            tasks[idx].removeExtension(key);
        });
        await saveTasks(tasks);
        return {
            content: [
                { type: "text", text: "Metadata removed successfully." },
            ],
        };
  • Zod schema defining input parameters: taskId (number) and keys (array of strings).
    {
        taskId: z.number(),
        keys: z.array(z.string()),
    },
  • src/tools.ts:251-279 (registration)
    Registration of the 'remove-metadata' tool on the MCP server, including name, description, schema, and handler.
    server.tool(
        "remove-metadata",
        "Remove specific metadata keys from a task by ID.",
        {
            taskId: z.number(),
            keys: z.array(z.string()),
        },
        async ({ taskId, keys }) => {
            const tasks = await loadTasks();
            const idx = getTaskIndex(taskId, tasks);
            if (idx === null) {
                return {
                    content: [
                        { type: "text", text: "Invalid task ID." },
                    ],
                    isError: true,
                };
            }
            keys.forEach((key: string) => {
                tasks[idx].removeExtension(key);
            });
            await saveTasks(tasks);
            return {
                content: [
                    { type: "text", text: "Metadata removed successfully." },
                ],
            };
        }
    );

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/guifelix/mcp-server-todotxt'

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