Skip to main content
Glama
aafsar

Task Manager MCP Server

by aafsar

clear_completed

Remove all completed tasks to declutter your task list and focus on active items.

Instructions

Remove all completed tasks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that executes the clear_completed tool logic: loads tasks, filters out completed tasks, saves the updated storage, and returns a formatted message indicating the number of tasks cleared.
    export async function clearCompleted() { const storage = await loadTasks(); const originalCount = storage.tasks.length; // Filter out completed tasks storage.tasks = storage.tasks.filter((t) => t.status !== "completed"); const removedCount = originalCount - storage.tasks.length; await saveTasks(storage); const message = removedCount > 0 ? `🧹 Cleared ${removedCount} completed task(s). ${storage.tasks.length} active task(s) remaining.` : "No completed tasks to clear."; return { content: [ { type: "text", text: message, }, ], }; }
  • src/index.ts:179-186 (registration)
    Tool registration in the TOOLS array used for ListTools response, defining name, description, and input schema (empty object since no parameters required).
    { name: "clear_completed", description: "Remove all completed tasks", inputSchema: { type: "object", properties: {}, }, },
  • src/index.ts:236-237 (registration)
    Switch case in the CallToolRequestHandler that routes requests for 'clear_completed' to the clearCompleted handler function.
    case "clear_completed": return await clearCompleted();
  • Input schema definition for the clear_completed tool, specifying an empty object since the tool takes no arguments.
    inputSchema: { type: "object", properties: {}, },

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/aafsar/task-manager-mcp-server'

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