update_note
Modify existing notes by updating title, content, pin status, archive status, background color, or attached image.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the note to update | |
| title | No | New title | |
| content | No | New content | |
| isPinned | No | Pin/unpin the note | |
| isArchived | No | Archive/unarchive the note | |
| color | No | New background color | |
| imageUrl | No | URL of an image to attach (or update existing) |
Implementation Reference
- src/index.ts:156-191 (handler)The registration and handler implementation for the update_note tool, which updates note properties via a PUT request.
server.tool( "update_note", { id: z.number().describe("ID of the note to update"), title: z.string().optional().describe("New title"), content: z.string().optional().describe("New content"), isPinned: z.boolean().optional().describe("Pin/unpin the note"), isArchived: z.boolean().optional().describe("Archive/unarchive the note"), color: z.enum(["white", "gray", "yellow", "orange", "teal", "blue", "purple", "pink"]).optional().describe("New background color"), imageUrl: z.string().url().optional().describe("URL of an image to attach (or update existing)"), }, async ({ id, ...updates }) => { try { // Filter out undefined values const body = Object.fromEntries( Object.entries(updates).filter(([_, v]) => v !== undefined) ); const data = await apiRequest(`/api/notes/${id}`, { method: "PUT", body: JSON.stringify(body), }); return { content: [{ type: "text", text: `Note ${id} updated successfully!` }] }; } catch (error) { return { content: [{ type: "text", text: `Error updating note: ${error}` }], isError: true