add_note
Adds task-specific notes to enhance context and track progress in the Divide and Conquer MCP Server, ensuring clarity and organized task management.
Instructions
Adds a note to the task.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The content of the note |
Implementation Reference
- src/index.ts:955-997 (handler)The handler function that implements the add_note tool. It validates the input, reads the current task data from file, appends a new note with timestamp, persists the updated data, and returns a success response.private async addNote(args: any): Promise<any> { if (!args?.content) { throw new McpError(ErrorCode.InvalidParams, 'Note content is required'); } try { const taskData = await this.readTaskData(); // Initialize the notes array if it doesn't exist if (!taskData.notes) { taskData.notes = []; } // Add the note taskData.notes.push({ timestamp: new Date().toISOString(), content: args.content }); // Write the updated task data to the file await this.writeTaskData(taskData); return { content: [ { type: 'text', text: 'Note added successfully.', }, ], }; } catch (error) { console.error('Error adding note:', error); return { content: [ { type: 'text', text: `Error adding note: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }
- src/index.ts:327-336 (schema)The input schema for the add_note tool, specifying that it requires a 'content' string parameter.inputSchema: { type: 'object', properties: { content: { type: 'string', description: 'The content of the note' } }, required: ['content'] }
- src/index.ts:324-337 (registration)Registration of the add_note tool in the MCP server's tools list, including name, description, and schema.{ name: 'add_note', description: 'Adds a note to the task.', inputSchema: { type: 'object', properties: { content: { type: 'string', description: 'The content of the note' } }, required: ['content'] } },
- src/index.ts:442-443 (registration)Dispatch case in the tool request handler that routes 'add_note' calls to the addNote method.case 'add_note': return await this.addNote(request.params.arguments);