complete_task
Mark tasks as completed by specifying task ID, adding completion notes, listing modified files, and tracking time spent. Integrates with Buildable projects via MCP for streamlined task management.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| completion_notes | Yes | Notes about task completion | |
| documentation_updated | No | Whether documentation was updated | |
| files_modified | No | List of files that were modified | |
| task_id | Yes | The ID of the task to complete | |
| testing_completed | No | Whether testing was completed | |
| time_spent | No | Total time spent in minutes |
Implementation Reference
- src/cli.ts:162-213 (registration)MCP tool registration for 'complete_task' using McpServer.tool(), including inline Zod input schema and async handler function.this.server.tool( 'complete_task', { task_id: z.string().describe('The ID of the task to complete'), completion_notes: z.string().describe('Notes about task completion'), files_modified: z .array(z.string()) .optional() .describe('List of files that were modified'), testing_completed: z .boolean() .optional() .describe('Whether testing was completed'), documentation_updated: z .boolean() .optional() .describe('Whether documentation was updated'), time_spent: z .number() .optional() .describe('Total time spent in minutes'), }, async ({ task_id, completion_notes, files_modified, testing_completed, documentation_updated, time_spent, }) => { if (!this.client) { throw new Error('Not connected to Buildable API'); } const result = await this.client.completeTask(task_id, { completion_notes, files_modified: files_modified || [], testing_completed: testing_completed || false, documentation_updated: documentation_updated || false, time_spent: time_spent || 0, }); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } );
- src/cli.ts:184-212 (handler)Handler function that executes the complete_task tool logic: checks client connection, calls BuildableMCPClient.completeTask API method, formats result as MCP content response.async ({ task_id, completion_notes, files_modified, testing_completed, documentation_updated, time_spent, }) => { if (!this.client) { throw new Error('Not connected to Buildable API'); } const result = await this.client.completeTask(task_id, { completion_notes, files_modified: files_modified || [], testing_completed: testing_completed || false, documentation_updated: documentation_updated || false, time_spent: time_spent || 0, }); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/cli.ts:164-183 (schema)Zod schema defining the input parameters for the complete_task MCP tool.{ task_id: z.string().describe('The ID of the task to complete'), completion_notes: z.string().describe('Notes about task completion'), files_modified: z .array(z.string()) .optional() .describe('List of files that were modified'), testing_completed: z .boolean() .optional() .describe('Whether testing was completed'), documentation_updated: z .boolean() .optional() .describe('Whether documentation was updated'), time_spent: z .number() .optional() .describe('Total time spent in minutes'), },
- src/client.ts:195-226 (helper)Supporting client method BuildableMCPClient.completeTask that performs the actual HTTP POST request to the Buildable API to complete the task.async completeTask( taskId: string, completion: CompleteTaskRequest ): Promise<CompleteTaskResponse> { this.log('debug', `Completing task ${taskId}...`); try { const response = await this.makeRequest<CompleteTaskResponse>( 'POST', `/tasks/${taskId}/complete`, { files_created: completion.files_modified, files_modified: completion.files_modified, completion_notes: completion.completion_notes, time_spent_minutes: completion.time_spent, verification_evidence: completion.testing_completed ? 'Tests passed' : undefined, } ); this.log('info', `Successfully completed task ${taskId}`); // Update connection status back to 'connected' await this.updateConnectionStatus('connected'); return response.data!; } catch (error) { this.log('error', `Failed to complete task ${taskId}:`, error); throw error; } }
- src/types.ts:116-125 (schema)TypeScript interface CompleteTaskRequest defining the structure for task completion data used by the client method.export interface CompleteTaskRequest { completion_notes: string; files_modified: string[]; testing_completed: boolean; documentation_updated: boolean; time_spent: number; // minutes challenges_faced?: string[]; lessons_learned?: string[]; next_recommendations?: string[]; }