Skip to main content
Glama
danjdewhurst

Todo Markdown MCP Server

by danjdewhurst

delete_todo

Remove a specific todo item from a markdown-based task list by providing its unique ID to maintain organized and current task management.

Instructions

Delete a todo item

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe todo item ID to delete

Implementation Reference

  • The core handler function that deletes a todo item by ID from the todo markdown file. It parses the file, removes the matching todo, and writes back the updated markdown.
    async deleteTodo(request: DeleteTodoRequest): Promise<void> {
      const todos = (await this.listTodos()).todos;
      const todoIndex = todos.findIndex((todo) => todo.id === request.id);
    
      if (todoIndex === -1) {
        throw new Error(`Todo with id ${request.id} not found`);
      }
    
      todos.splice(todoIndex, 1);
    
      const markdown = this.formatTodoMarkdown(todos);
    
      try {
        await writeFile(this.todoFilePath, markdown, 'utf-8');
      } catch (error) {
        if (error instanceof Error && error.message.includes('EACCES')) {
          throw new Error(
            `Permission denied: Cannot write to ${this.todoFilePath}. Check file permissions or set TODO_FILE_PATH environment variable to a writable location.`
          );
        } else if (error instanceof Error && error.message.includes('EROFS')) {
          throw new Error(
            `Read-only file system: Cannot write to ${this.todoFilePath}. Set TODO_FILE_PATH environment variable to a writable location.`
          );
        }
        throw error;
      }
    }
  • The MCP CallToolRequest handler case for 'delete_todo', which validates the input arguments and delegates to the todoManager.deleteTodo method, returning a success message.
    case 'delete_todo': {
      const args = request.params
        .arguments as unknown as DeleteTodoRequest;
      if (!args?.id || typeof args.id !== 'string') {
        throw new Error('ID is required and must be a string');
      }
    
      await this.todoManager.deleteTodo(args);
      return {
        content: [
          {
            type: 'text',
            text: `Todo with ID ${args.id} deleted successfully`,
          },
        ],
      };
    }
  • src/index.ts:87-101 (registration)
    Tool registration in the ListToolsRequestHandler response, defining the name, description, and input schema for the 'delete_todo' tool.
    {
      name: 'delete_todo',
      description: 'Delete a todo item',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'The todo item ID to delete',
          },
        },
        required: ['id'],
        additionalProperties: false,
      },
    },
  • TypeScript type definition for the DeleteTodoRequest used by the delete_todo handlers.
    export interface DeleteTodoRequest {
      id: string;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Delete' implies a destructive operation, it doesn't specify whether deletion is permanent, reversible, requires specific permissions, or what happens on success/failure. This is inadequate for a mutation tool with zero annotation coverage.

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 a single, efficient sentence with zero wasted words. It's appropriately sized for a simple tool and front-loads the essential information immediately.

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?

For a destructive operation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after deletion, whether there's confirmation, what the return value might be, or how this differs from similar sibling tools. The context demands more completeness.

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

Parameters3/5

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

The schema description coverage is 100%, with the single parameter 'id' clearly documented in the schema. The description adds no additional parameter information beyond what the schema already provides, which meets the baseline expectation when schema coverage is complete.

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 todo item'), making the purpose immediately understandable. However, it doesn't distinguish this tool from sibling tools like 'clear_completed' which also removes todo items, missing an opportunity for differentiation.

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 'clear_completed' (which removes multiple items) or 'update_todo' (which might mark as deleted). There's no mention of prerequisites, error conditions, or appropriate contexts for deletion.

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/danjdewhurst/todo-md-mcp'

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