clear_task
Clear current task data to reset progress or start fresh within the Divide and Conquer MCP Server's structured task management system.
Instructions
Clears the current task data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1089-1113 (handler)The handler function that executes the clear_task tool logic: reads the config, resets to DEFAULT_TASK_DATA, updates metadata/progress, and writes back to the config file.
private async clearTask(): Promise<any> { try { // Write the default task data to the file await this.writeTaskData({ ...DEFAULT_TASK_DATA }); return { content: [ { type: 'text', text: 'Task cleared successfully.', }, ], }; } catch (error) { console.error('Error clearing task:', error); return { content: [ { type: 'text', text: `Error clearing task: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } - src/index.ts:388-392 (schema)The input schema for the clear_task tool, which requires no parameters.
inputSchema: { type: 'object', properties: {}, required: [] } - src/index.ts:385-393 (registration)Registration of the clear_task tool in the listTools response, including name, description, and schema.
{ name: 'clear_task', description: 'Clears the current task data.', inputSchema: { type: 'object', properties: {}, required: [] } }, - src/index.ts:448-449 (registration)Dispatch in the CallToolRequestSchema handler switch statement that routes clear_task calls to the clearTask method.
case 'clear_task': return await this.clearTask(); - src/index.ts:61-74 (helper)Default task data structure used by clearTask to reset the current task to an empty state.
const DEFAULT_TASK_DATA: TaskData = { task_description: '', checklist: [], context_for_all_tasks: '', metadata: { created_at: new Date().toISOString(), updated_at: new Date().toISOString(), progress: { completed: 0, total: 0, percentage: 0 } } };