Skip to main content
Glama

complete_task

Mark tasks as finished in Task Trellis MCP by recording completion details, updating status to 'done', tracking file changes, and triggering dependent tasks.

Instructions

Completes a task in the task trellis system

Use this tool to mark a task as finished and record completion details. Critical for task lifecycle management and maintaining accurate project status.

Required completion data:

  • 'taskId': Unique identifier of the task being completed

  • 'summary': Concise description of what was accomplished

  • 'filesChanged': Map of modified files with descriptions of changes made

Completion process:

  1. Validates task is in a completable state ('in-progress')

  2. Updates task status to 'done'

  3. Records completion timestamp and summary

  4. Associates file changes with the task for traceability

  5. Updates parent-child relationships and dependency chains

  6. Triggers any dependent tasks that were waiting for this completion

File change tracking:

  • Key: relative file path from project root

  • Value: description of changes made to that file

  • Example: {'src/api/users.ts': 'Added user authentication endpoints', 'tests/auth.test.ts': 'Added comprehensive auth test coverage'}

Best practices:

  • Provide clear, actionable summaries that explain the outcome

  • Document all meaningful file changes for future reference

  • Complete tasks only when all acceptance criteria are met

  • Verify dependent tasks can now proceed before completion

  • Include any important notes or lessons learned in the summary

Task completion automatically notifies dependent tasks and may trigger workflow progression for related work items.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYesID of the task to complete
summaryYesSummary of the completed task
filesChangedYesMap of files changed with their descriptions

Implementation Reference

  • The handler function for the 'complete_task' MCP tool. It validates and extracts input arguments then delegates execution to the TaskTrellisService.completeTask method.
    export function handleCompleteTask( service: TaskTrellisService, repository: Repository, args: unknown, serverConfig: ServerConfig, ) { const { taskId, summary, filesChanged } = args as { taskId: string; summary: string; filesChanged: Record<string, string>; }; // Delegate to service.completeTask return service.completeTask( repository, serverConfig, taskId, summary, filesChanged, ); }
  • The input schema definition for the 'complete_task' tool, specifying required parameters: taskId, summary, and filesChanged.
    inputSchema: { type: "object", properties: { taskId: { type: "string", description: "ID of the task to complete", }, summary: { type: "string", description: "Summary of the completed task", }, filesChanged: { type: "object", additionalProperties: { type: "string", }, description: "Map of files changed with their descriptions", }, }, required: ["taskId", "summary", "filesChanged"], },
  • src/server.ts:274-275 (registration)
    Registration of the 'complete_task' tool handler in the server's CallToolRequest switch statement.
    case "complete_task": return handleCompleteTask(_getService(), repository, args, serverConfig);
  • src/server.ts:187-188 (registration)
    Inclusion of completeTaskTool in the list of available tools returned by ListToolsRequest.
    completeTaskTool, ];
  • Core helper function implementing the task completion logic: validates task status, updates to DONE, appends files changed and summary to log, saves, and optionally auto-completes parents.
    export async function completeTask( repository: Repository, serverConfig: ServerConfig, taskId: string, summary: string, filesChanged: Record<string, string>, ): Promise<{ content: Array<{ type: string; text: string }> }> { // Get the task object from repository const task = await repository.getObjectById(taskId); if (!task) { throw new Error(`Task with ID "${taskId}" not found`); } // Check if task is in progress if (task.status !== TrellisObjectStatus.IN_PROGRESS) { throw new Error( `Task "${taskId}" is not in progress (current status: ${task.status})`, ); } // Update task status to done task.status = TrellisObjectStatus.DONE; // Append to affected files map await appendAffectedFiles(repository, task, filesChanged); // Append summary to log task.log.push(summary); // Save the updated task await repository.saveObject(task); // If auto-complete parent is enabled, check if we should complete parent objects if (serverConfig.autoCompleteParent) { await autoCompleteParentHierarchy(repository, task); } return { content: [ { type: "text", text: `Task "${taskId}" completed successfully. Updated ${Object.keys(filesChanged).length} affected files.`, }, ], }; }

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/langadventurellc/task-trellis-mcp'

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