Skip to main content
Glama

remove_todo

Delete a specific todo item from your persistent list by providing its unique identifier to maintain an organized task management system.

Instructions

Remove a todo by id

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • The handler function that implements the remove_todo tool logic: reads todos, filters out the one with matching ID, writes back if changed, and returns appropriate message.
    async ({ id }) => {
      const todos = await readTodos();
      const next = todos.filter((t) => t.id !== id);
      if (next.length === todos.length)
        return { content: [{ type: "text", text: `No todo with id ${id}` }] };
      await writeTodos(next);
      return { content: [{ type: "text", text: `Removed #${id}` }] };
    }
  • Schema for the remove_todo tool: title, description, and input schema requiring a positive integer 'id'.
    {
      title: "Remove Todo",
      description: "Remove a todo by id",
      inputSchema: { id: z.number().int().positive() },
    },
  • src/server.ts:114-129 (registration)
    Registration of the 'remove_todo' tool on the MCP server, including schema and handler.
    server.registerTool(
      "remove_todo",
      {
        title: "Remove Todo",
        description: "Remove a todo by id",
        inputSchema: { id: z.number().int().positive() },
      },
      async ({ id }) => {
        const todos = await readTodos();
        const next = todos.filter((t) => t.id !== id);
        if (next.length === todos.length)
          return { content: [{ type: "text", text: `No todo with id ${id}` }] };
        await writeTodos(next);
        return { content: [{ type: "text", text: `Removed #${id}` }] };
      }
    );
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/CalamityAdam/mcp-todo'

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