Skip to main content
Glama
Rudra-ravi

MCP TaskManager

by Rudra-ravi

approve_task_completion

Approve completed tasks in the MCP TaskManager workflow to verify genuine completion before proceeding to the next task in the queue.

Instructions

Once the assistant has marked a task as done using 'mark_task_done', the user must call this tool to approve that the task is genuinely completed. Only after this approval can you proceed to 'get_next_task' to move on.

A progress table will be displayed before requesting approval, showing the current status of all tasks.

If the user does not approve, do not call 'get_next_task'. Instead, the user may request changes, or even re-plan tasks by using 'request_planning' again.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestIdYes
taskIdYes

Implementation Reference

  • The core handler function that locates the request and task by ID, sets the task's approved flag to true, persists the change, and returns a progress table.
    public async approveTaskCompletion(requestId: string, taskId: string) {
      const request = this.data.requests.find((r) => r.requestId === requestId);
      if (!request) {
        throw new Error("Request not found");
      }
    
      const task = request.tasks.find((t) => t.id === taskId);
      if (!task) {
        throw new Error("Task not found");
      }
    
      task.approved = true;
    
      await this.saveTasks();
    
      return {
        message:
          "Task completion approved.\n" + this.formatTaskProgressTable(requestId),
      };
    }
  • Zod schema defining the input parameters: requestId and taskId as strings.
    const ApproveTaskCompletionSchema = z.object({
      requestId: z.string(),
      taskId: z.string(),
    });
  • index.ts:160-164 (registration)
    Tool registration object returned by listTools(), specifying name, description, and input schema.
    {
      name: "approve_task_completion",
      description: "Approve a completed task.",
      inputSchema: ApproveTaskCompletionSchema,
    },
  • Dispatcher case in callTool method that validates input using the schema and invokes the handler.
    case "approve_task_completion": {
      const parsed = ApproveTaskCompletionSchema.safeParse(parameters);
      if (!parsed.success) {
        throw new Error(`Invalid parameters: ${parsed.error}`);
      }
      return this.approveTaskCompletion(
        parsed.data.requestId,
        parsed.data.taskId
      );
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's role in a workflow (approval after marking done) and consequences (proceeding to 'get_next_task' only after approval). However, it lacks details on error handling, response format, or side effects like whether approval is reversible. The description adds meaningful context but doesn't fully cover behavioral traits.

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 well-structured and front-loaded with the core purpose. Each sentence adds value: the first explains the tool's role, the second mentions the progress table, and the third covers alternative actions. It could be slightly more concise by integrating the progress table mention into the workflow explanation, but overall it's efficient with minimal waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description provides good contextual completeness. It explains the tool's place in a workflow, prerequisites, and consequences. However, it doesn't detail what happens upon successful approval (e.g., state changes) or error cases, leaving some gaps for a tool with mutation implications.

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 input schema has 0% description coverage, so the description must compensate. While it doesn't explicitly explain the 'requestId' and 'taskId' parameters, it implicitly clarifies their purpose by describing the approval process for a specific task within a request context. This adds semantic meaning beyond the bare schema, though it could be more explicit about parameter roles.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'the user must call this tool to approve that the task is genuinely completed' after using 'mark_task_done'. It specifies the verb (approve) and resource (task completion), and distinguishes it from sibling tools like 'approve_request_completion' by focusing on task-level approval rather than request-level.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool: 'Once the assistant has marked a task as done using 'mark_task_done', the user must call this tool to approve that the task is genuinely completed.' It also specifies alternatives and exclusions: 'If the user does not approve, do not call 'get_next_task'. Instead, the user may request changes, or even re-plan tasks by using 'request_planning' again.'

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.