Skip to main content
Glama
rwese
by rwese

todo-done

Mark backlog todos as complete while validating dependencies to ensure proper workflow progression in project management.

Instructions

Mark backlog todos as complete with dependency validation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesOperation to perform
topicYesTopic name (required)
todoIdNoTodo ID (required for done)
statusNoFilter by status (for list)
batchNoFilter by batch (for list)

Implementation Reference

  • Primary handler function for the 'todo-done' tool. Handles 'done' action by validating dependencies before marking a todo as completed, and 'list' action by delegating to todo-read handler.
    async function handleBacklogTodoDone(args: any) {
      const { action, topic, todoId, status, batch } = args;
      if (!topic) throw new Error("topic is required");
    
      switch (action) {
        case "done": {
          if (!todoId) throw new Error("todoId is required for done action");
          
          const data = readTodos(topic);
          if (data.todos.length === 0) throw new Error("No todos found for this backlog item");
          
          const todo = data.todos.find((t: any) => t.id === todoId);
          if (!todo) throw new Error(`Todo not found: ${todoId}`);
          
          // Validate dependencies
          const validation = validateDependencies(data.todos, todoId);
          if (!validation.valid) {
            const errors = [];
            if (validation.missing.length > 0) {
              errors.push(`Missing dependencies: ${validation.missing.join(', ')}`);
            }
            if (validation.incomplete.length > 0) {
              errors.push(`Incomplete dependencies: ${validation.incomplete.join(', ')}`);
            }
            throw new Error(errors.join('; '));
          }
          
          todo.status = "completed";
          (todo as any).completedAt = new Date().toISOString();
          
          writeTodos(topic, data);
          return `Marked todo as done: ${todoId}`;
        }
    
        case "list": {
          return await handleBacklogTodoRead({ topic, status, batch });
        }
    
        default:
          throw new Error(`Unknown action: ${action}`);
      }
    }
  • JSON Schema defining the input parameters for the 'todo-done' tool, including action (done/list), required topic, optional todoId, status, and batch filters.
    inputSchema: {
      type: "object",
      properties: {
        action: {
          type: "string",
          enum: ["done", "list"],
          description: "Operation to perform",
        },
        topic: {
          type: "string",
          description: "Topic name (required)",
        },
        todoId: {
          type: "string",
          description: "Todo ID (required for done)",
        },
        status: {
          type: "string",
          enum: ["pending", "in_progress", "completed", "cancelled"],
          description: "Filter by status (for list)",
        },
        batch: {
          type: "string",
          description: "Filter by batch (for list)",
        },
      },
      required: ["action", "topic"],
    },
  • src/index.ts:784-815 (registration)
    Registration of the 'todo-done' tool in the ListToolsRequest handler, including name, description, and full input schema.
    {
      name: "todo-done",
      description: "Mark backlog todos as complete with dependency validation",
      inputSchema: {
        type: "object",
        properties: {
          action: {
            type: "string",
            enum: ["done", "list"],
            description: "Operation to perform",
          },
          topic: {
            type: "string",
            description: "Topic name (required)",
          },
          todoId: {
            type: "string",
            description: "Todo ID (required for done)",
          },
          status: {
            type: "string",
            enum: ["pending", "in_progress", "completed", "cancelled"],
            description: "Filter by status (for list)",
          },
          batch: {
            type: "string",
            description: "Filter by batch (for list)",
          },
        },
        required: ["action", "topic"],
      },
    },
  • src/index.ts:843-845 (registration)
    Routing case in the CallToolRequest handler that dispatches 'todo-done' tool calls to the handleBacklogTodoDone function.
    case "todo-done":
      result = await handleBacklogTodoDone(request.params.arguments);
      break;
  • Helper function validateDependencies used by the handler to ensure all dependencies of a todo are completed before marking it done.
    export function validateDependencies(todos: Todo[], todoId: string): { valid: boolean, missing: string[], incomplete: string[] } {
      const todo = todos.find(t => t.id === todoId);
      if (!todo) {
        throw new Error(`Todo with ID ${todoId} not found`);
      }
    
      const missing: string[] = [];
      const incomplete: string[] = [];
    
      for (const depId of todo.dependencies) {
        const dep = todos.find(t => t.id === depId);
        if (!dep) {
          missing.push(depId);
        } else if (dep.status !== "completed") {
          incomplete.push(depId);
        }
      }
    
      return {
        valid: missing.length === 0 && incomplete.length === 0,
        missing,
        incomplete
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions 'dependency validation' which hints at a behavioral trait (checking dependencies before marking as complete), but doesn't disclose other critical aspects like required permissions, side effects, error handling, or what happens if validation fails. For a mutation tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action. It avoids unnecessary words, though it could be slightly more structured by explicitly separating purpose from constraints.

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 complexity (mutation with dependency validation), no annotations, no output schema, and 5 parameters, the description is incomplete. It lacks details on behavioral traits, return values, error cases, and usage context, making it inadequate for safe and effective tool invocation.

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?

Schema description coverage is 100%, so the schema already documents all parameters. The description adds no additional meaning beyond what's in the schema, such as explaining the dependency validation process or how parameters interact. Baseline 3 is appropriate when the schema does the heavy lifting.

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 verb ('Mark') and resource ('backlog todos') with a specific condition ('as complete with dependency validation'). It distinguishes from siblings like 'todo-read' or 'todo-write' by focusing on completion with validation, though it doesn't explicitly contrast with 'done' which might be a similar sibling tool.

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 'done', 'todo-write', or others. It mentions dependency validation but doesn't specify prerequisites, exclusions, or scenarios where this tool is preferred over siblings, leaving usage context unclear.

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/rwese/mcp-backlog'

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