delete_note
Remove a specific note from a request in TaskFlow MCP by providing the 'requestId' and 'noteId'. Helps manage and organize task-related details effectively.
Instructions
Delete a note from a request.
Provide the 'requestId' and 'noteId' of the note to delete.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| noteId | Yes | ||
| requestId | Yes |
Input Schema (JSON Schema)
{
"properties": {
"noteId": {
"type": "string"
},
"requestId": {
"type": "string"
}
},
"required": [
"requestId",
"noteId"
],
"type": "object"
}
Implementation Reference
- src/tools/TaskFlowTools.ts:635-638 (handler)MCP tool handler function for 'delete_note' that extracts arguments and delegates to TaskFlowService.deleteNote method.async delete_note(args: any) { const { requestId, noteId } = args ?? {}; return service.deleteNote(String(requestId), String(noteId)); },
- JSON Schema definition for the input parameters of the delete_note tool (requestId and noteId).delete_note: { type: "object", properties: { requestId: { type: "string" }, noteId: { type: "string" }, }, required: ["requestId", "noteId"], },
- src/server/TaskFlowServer.ts:63-90 (registration)Registration of DELETE_NOTE_TOOL in the MCP server's listTools handler, making it discoverable by clients.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, ], }));
- Core service method implementing the deletion logic: loads data, finds and removes the specified note from the request, saves changes.public async deleteNote(requestId: string, noteId: 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" }; req.notes.splice(noteIndex, 1); await this.saveTasks(); return { status: "note_deleted", message: `Note ${noteId} has been deleted.` }; }
- src/tools/TaskFlowTools.ts:385-398 (registration)Static Tool object definition for delete_note, including name, description, and inputSchema, exported for use in server registration.export const DELETE_NOTE_TOOL: Tool = { name: "delete_note", description: "Delete a note from a request.\n\n" + "Provide the 'requestId' and 'noteId' of the note to delete.", inputSchema: { type: "object", properties: { requestId: { type: "string" }, noteId: { type: "string" }, }, required: ["requestId", "noteId"], }, };