Skip to main content
Glama
danjdewhurst

Todo Markdown MCP Server

by danjdewhurst

clear_completed

Remove completed tasks from your todo list to maintain focus on pending items and declutter your markdown file.

Instructions

Remove all completed todo items

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'clear_completed': calls todoManager.clearCompleted() and returns formatted response with count of cleared todos.
    case 'clear_completed': {
      const count = await this.todoManager.clearCompleted();
      return {
        content: [
          {
            type: 'text',
            text: `Cleared ${count} completed todo(s)`,
          },
        ],
      };
    }
  • Core implementation: filters out completed todos, rewrites the markdown file with remaining todos, handles file write errors, returns count of cleared items.
    async clearCompleted(): Promise<number> {
      const todos = (await this.listTodos()).todos;
      const completedCount = todos.filter((todo) => todo.completed).length;
      const remainingTodos = todos.filter((todo) => !todo.completed);
    
      const markdown = this.formatTodoMarkdown(remainingTodos);
    
      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;
      }
    
      return completedCount;
    }
  • src/index.ts:102-110 (registration)
    Registers the 'clear_completed' tool in the ListTools response, including name, description, and empty input schema (no parameters required).
    {
      name: 'clear_completed',
      description: 'Remove all completed todo items',
      inputSchema: {
        type: 'object',
        properties: {},
        additionalProperties: false,
      },
    },
  • Defines the input schema for 'clear_completed' tool: empty object, no required properties.
    inputSchema: {
      type: 'object',
      properties: {},
      additionalProperties: false,
    },
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. It states the tool removes items, implying a destructive mutation, but lacks critical details: whether the removal is permanent or reversible, if it requires confirmation, what happens on success/failure, or if there are rate limits. The description adds minimal value beyond the basic action.

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 front-loaded with the core action ('Remove all completed todo items'), making it immediately scannable. Every word earns its place by specifying the scope ('all completed') and target ('todo items').

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 (removing items) and lack of annotations or output schema, the description is incomplete. It doesn't address behavioral risks (e.g., irreversibility), success indicators, or error conditions. For a mutation tool with zero structured metadata, more context is needed to ensure safe and correct usage by an agent.

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

Parameters4/5

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

The tool has zero parameters, and schema description coverage is 100% (since there are no parameters to describe). The description doesn't need to compensate for any parameter gaps, and it correctly implies no inputs are required. This meets the baseline for a parameterless tool, though it doesn't add extra semantic context (e.g., explaining why no parameters are needed).

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 ('Remove') and target resource ('all completed todo items'), making the purpose immediately understandable. It doesn't explicitly distinguish from sibling tools like 'delete_todo' (which likely deletes specific items), but the scope 'all completed' provides some differentiation. The description avoids tautology by specifying what gets removed rather than just restating the name.

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 'delete_todo' or 'update_todo' (which might mark items as completed). There's no mention of prerequisites (e.g., whether items must be marked as completed first) or exclusions (e.g., if it affects only certain types of todos). The agent must infer usage from context alone.

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