Skip to main content
Glama

remove-metadata

Eliminate unwanted metadata from tasks in Todo.txt files by specifying the task ID and keys to remove, ensuring cleaner and more organized task management.

Instructions

Remove specific metadata keys from a task by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keysYes
taskIdYes

Implementation Reference

  • The handler function that implements the 'remove-metadata' tool logic. Loads the todo tasks, finds the task by 1-based ID using helper, removes each specified key from the task's extensions (metadata), persists changes, 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." }, ], }; }
  • Input schema definition using Zod for validating the tool parameters: taskId as number, keys as array of strings.
    { taskId: z.number(), keys: z.array(z.string()), },
  • src/tools.ts:251-279 (registration)
    The server.tool call that registers the 'remove-metadata' tool with the MCP server, providing name, description, input schema, and handler function.
    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." }, ], }; } );

Other Tools

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

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