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, },

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