add_note
Attach contextual information to task requests, enabling clear communication of project details, user preferences, or guidelines for reference during task execution.
Instructions
Add a note to a request. Notes can contain important information about the project, such as user preferences or guidelines.
Notes are displayed in the task progress table and can be referenced when working on tasks.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| requestId | Yes | ||
| title | Yes | ||
| content | Yes |
Implementation Reference
- src/tools/TaskFlowTools.ts:625-628 (handler)Handler function for the 'add_note' tool that extracts requestId, title, and content from args and calls TaskFlowService.addNoteasync add_note(args: any) { const { requestId, title, content } = args ?? {}; return service.addNote(String(requestId), String(title), String(content)); },
- src/tools/TaskFlowTools.ts:352-366 (schema)Tool definition for 'add_note' including name, description, and input schema validationexport const ADD_NOTE_TOOL: Tool = { name: "add_note", description: "Add a note to a request. Notes can contain important information about the project, such as user preferences or guidelines.\n\n" + "Notes are displayed in the task progress table and can be referenced when working on tasks.", inputSchema: { type: "object", properties: { requestId: { type: "string" }, title: { type: "string" }, content: { type: "string" }, }, required: ["requestId", "title", "content"], }, };
- src/server/TaskFlowServer.ts:63-90 (registration)Registration of ADD_NOTE_TOOL in the list of tools returned by ListToolsRequestHandlerthis.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ PLAN_TASK_TOOL, GET_NEXT_TASK_TOOL, MARK_TASK_DONE_TOOL, OPEN_TASK_DETAILS_TOOL, LIST_REQUESTS_TOOL, ADD_TASKS_TO_REQUEST_TOOL, UPDATE_TASK_TOOL, DELETE_TASK_TOOL, ADD_SUBTASKS_TOOL, MARK_SUBTASK_DONE_TOOL, UPDATE_SUBTASK_TOOL, DELETE_SUBTASK_TOOL, EXPORT_TASK_STATUS_TOOL, ADD_NOTE_TOOL, UPDATE_NOTE_TOOL, DELETE_NOTE_TOOL, ADD_DEPENDENCY_TOOL, GET_PROMPTS_TOOL, SET_PROMPTS_TOOL, UPDATE_PROMPTS_TOOL, REMOVE_PROMPTS_TOOL, ARCHIVE_COMPLETED_REQUESTS_TOOL, LIST_ARCHIVED_REQUESTS_TOOL, RESTORE_ARCHIVED_REQUEST_TOOL, ], }));
- Core service method that implements adding a note to a request: generates ID, sanitizes inputs, persists to file, and returns confirmationpublic async addNote(requestId: string, title: string, content: string) { await this.loadTasks(); const req = this.getRequest(requestId); if (!req) return { status: "error", message: "Request not found" }; const now = new Date().toISOString(); const factory = new TaskFactory({ value: this.globalIdCounter }); const noteId = factory.createNoteId(); this.globalIdCounter = factory["counterRef"].value; const note: Note = { id: noteId, title: sanitizeString(title), content: sanitizeString(content), createdAt: now, updatedAt: now, }; if (!req.notes) req.notes = []; req.notes.push(note); await this.saveTasks(); return { status: "note_added", message: `Note "${title}" has been added to request ${requestId}.`, note, }; }