Skip to main content
Glama

aida_task_done

Mark tasks as completed and automatically calculate time spent to track development progress in AI coding sessions.

Instructions

当你完成一个任务后调用。标记任务为已完成,自动计算耗时。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYes任务ID,如 TASK-01。如不确定,可调用 aida_status 查看。

Implementation Reference

  • The handleTaskDone function implements the logic for 'aida_task_done', updating task status, calculating token consumption, and saving the state.
    function handleTaskDone(args: any): any {
      const { path, data } = ensureRunJson();
      const task = data.tasks.find(t => t.taskId === args.taskId);
      if (!task) return { success: false, message: `任务 ${args.taskId} 未找到` };
    
      task.status = 'done';
      task.completedAt = now();
      if (!task.startedAt) task.startedAt = task.createdAt || task.completedAt;
      data.summary.completedTasks = data.tasks.filter(t => t.status === 'done').length;
    
      // Auto-collect tokens for this task
      let taskTokens = 0;
      if (task.startedAt && task.completedAt) {
        taskTokens = getTaskTokens(task.startedAt, task.completedAt);
        if (taskTokens > 0) {
          (task as any).tokensConsumed = taskTokens;
          // Add to cost breakdown
          if (!data.cost) data.cost = {};
          if (!data.cost.tokenBreakdown) data.cost.tokenBreakdown = [];
          data.cost.tokenBreakdown.push({
            stage: `task:${args.taskId}`,
            tokens: taskTokens,
          });
        }
      }
    
      addEvent(data, 'task_completed', { taskId: args.taskId, tokensConsumed: taskTokens });
      addTimeline(data, 'task-done', `${args.taskId}: ${task.title}`);
      save(path, data);
    
      // Sync total token usage from session
      syncTokenUsage(path, data);
    
      const tokenMsg = taskTokens > 0 ? ` (${taskTokens} tokens)` : '';
      return { success: true, message: `${args.taskId} 已完成${tokenMsg}` };
    }
  • Tool registration for 'aida_task_done' within the MCP server definition.
        },
        required: ['title'],
      },
    },
    {
      name: 'aida_task_done',
      description: '当你完成一个任务后调用。标记任务为已完成,自动计算耗时。',
      inputSchema: {
        type: 'object',
        properties: {
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 disclosure. It successfully communicates one key behavioral trait—the automatic calculation of time consumed ('自动计算耗时')—but omits other critical mutation details such as reversibility (can a task be un-marked?), side effects, error conditions, or the nature of the return value.

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 consists of two highly efficient sentences: the first establishes the trigger condition, and the second lists the dual effects (marking completion and time calculation). There is zero redundancy or filler, with critical information front-loaded.

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 simplicity (single string parameter, no nested objects, 100% schema coverage) and the absence of an output schema, the description adequately covers the essential invocation context and primary effect. It lacks safety annotations (destructive/reversible hints) which would be expected for a state-transition mutation, but remains sufficient for agent selection given the clear lifecycle positioning.

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?

With 100% schema coverage, the input schema fully documents the taskId parameter including examples and cross-references to aida_status. The main description does not add parameter-specific semantics beyond what the schema already provides, warranting the baseline score of 3.

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 specific action (mark task completed) and trigger condition (after finishing a task), with a distinct behavioral detail (automatic time calculation). It implicitly contrasts with sibling aida_task_start through the temporal marker '完成后' (after completion), clearly positioning it in the task lifecycle.

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

Usage Guidelines4/5

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

The description provides explicit temporal guidance on when to invoke ('当你完成一个任务后调用' / call after completing a task). However, it does not explicitly reference sibling alternatives like aida_task_start for initiation or caution against using this for starting tasks, nor does it mention the aida_status reference found in the parameter schema.

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/LWTlong/ai-dev-analytics'

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