update_note
Modify an existing note’s title or content in TaskFlow MCP by providing the request ID, note ID, and optional updates to streamline task tracking and management.
Instructions
Update an existing note's title or content.
Provide the 'requestId' and 'noteId', and optionally 'title' and/or 'content' to update.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | ||
| noteId | Yes | ||
| requestId | Yes | ||
| title | No |
Implementation Reference
- src/tools/TaskFlowTools.ts:630-633 (handler)The core handler function for the 'update_note' MCP tool. It extracts arguments and delegates to TaskFlowService.updateNote method.async update_note(args: any) { const { requestId, noteId, title, content } = args ?? {}; return service.updateNote(String(requestId), String(noteId), { title, content }); },
- The service layer method implementing the note update logic: loads data, finds and updates the note, sanitizes inputs, saves changes, and returns status.public async updateNote(requestId: string, noteId: string, updates: { title?: string; content?: string }) { await this.loadTasks(); const req = this.getRequest(requestId); if (!req) return { status: "error", message: "Request not found" }; if (!req.notes) return { status: "error", message: "No notes found for this request" }; const noteIndex = req.notes.findIndex((n) => n.id === noteId); if (noteIndex === -1) return { status: "error", message: "Note not found" }; const note = req.notes[noteIndex]; if (updates.title) note.title = sanitizeString(updates.title); if (updates.content) note.content = sanitizeString(updates.content); note.updatedAt = new Date().toISOString(); await this.saveTasks(); return { status: "note_updated", message: `Note ${noteId} has been updated.`, note }; }
- JSON Schema definition for 'update_note' tool inputs, defining properties and required fields for validation.update_note: { type: "object", properties: { requestId: { type: "string" }, noteId: { type: "string" }, title: { type: "string" }, content: { type: "string" }, }, required: ["requestId", "noteId"], },
- src/server/TaskFlowServer.ts:63-89 (registration)Server registration of all tools including UPDATE_NOTE_TOOL in the ListToolsRequest handler, making the tool discoverable.this.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, ],
- src/tools/TaskFlowTools.ts:368-383 (schema)Tool object definition with name, description, and inline inputSchema for 'update_note', exported for use in server registration.export const UPDATE_NOTE_TOOL: Tool = { name: "update_note", description: "Update an existing note's title or content.\n\n" + "Provide the 'requestId' and 'noteId', and optionally 'title' and/or 'content' to update.", inputSchema: { type: "object", properties: { requestId: { type: "string" }, noteId: { type: "string" }, title: { type: "string" }, content: { type: "string" }, }, required: ["requestId", "noteId"], }, };