edit_node
Modify an existing node in Dynalist documents by updating content, notes, formatting, or status to maintain organized outlines and lists.
Instructions
Edit an existing node in a Dynalist document
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Dynalist URL with node deep link | |
| file_id | No | Document ID (alternative to URL) | |
| node_id | Yes | Node ID to edit | |
| content | No | New content text | |
| note | No | New note text | |
| checked | No | Checked status | |
| checkbox | No | Whether to show checkbox | |
| heading | No | Heading level (0-3) | |
| color | No | Color label (0-6) |
Implementation Reference
- src/tools/index.ts:395-448 (registration)Registration of the 'edit_node' tool using server.tool, including schema and handler.server.tool( "edit_node", "Edit an existing node in a Dynalist document", { url: z.string().optional().describe("Dynalist URL with node deep link"), file_id: z.string().optional().describe("Document ID (alternative to URL)"), node_id: z.string().describe("Node ID to edit"), content: z.string().optional().describe("New content text"), note: z.string().optional().describe("New note text"), checked: z.boolean().optional().describe("Checked status"), checkbox: z.boolean().optional().describe("Whether to show checkbox"), heading: z.number().min(0).max(3).optional().describe("Heading level (0-3)"), color: z.number().min(0).max(6).optional().describe("Color label (0-6)"), }, async ({ url, file_id, node_id, content, note, checked, checkbox, heading, color }) => { let documentId = file_id; if (url) { const parsed = parseDynalistUrl(url); documentId = parsed.documentId; } if (!documentId) { return { content: [{ type: "text", text: "Error: Either 'url' or 'file_id' must be provided" }], isError: true, }; } const change: Record<string, unknown> = { action: "edit", node_id, }; // Only include fields that are explicitly set if (content !== undefined) change.content = content; if (note !== undefined) change.note = note; if (checked !== undefined) change.checked = checked; if (checkbox !== undefined) change.checkbox = checkbox; if (heading !== undefined) change.heading = heading; if (color !== undefined) change.color = color; const response = await client.editDocument(documentId, [change as any]); return { content: [ { type: "text", text: `Node edited successfully!\nDocument: ${documentId}\nNode: ${node_id}`, }, ], }; } );
- src/tools/index.ts:398-408 (schema)Input schema using Zod for validating parameters like node_id, content, note, etc.{ url: z.string().optional().describe("Dynalist URL with node deep link"), file_id: z.string().optional().describe("Document ID (alternative to URL)"), node_id: z.string().describe("Node ID to edit"), content: z.string().optional().describe("New content text"), note: z.string().optional().describe("New note text"), checked: z.boolean().optional().describe("Checked status"), checkbox: z.boolean().optional().describe("Whether to show checkbox"), heading: z.number().min(0).max(3).optional().describe("Heading level (0-3)"), color: z.number().min(0).max(6).optional().describe("Color label (0-6)"), },
- src/tools/index.ts:409-447 (handler)Handler function that parses input, constructs edit change object, calls client.editDocument, and returns success message.async ({ url, file_id, node_id, content, note, checked, checkbox, heading, color }) => { let documentId = file_id; if (url) { const parsed = parseDynalistUrl(url); documentId = parsed.documentId; } if (!documentId) { return { content: [{ type: "text", text: "Error: Either 'url' or 'file_id' must be provided" }], isError: true, }; } const change: Record<string, unknown> = { action: "edit", node_id, }; // Only include fields that are explicitly set if (content !== undefined) change.content = content; if (note !== undefined) change.note = note; if (checked !== undefined) change.checked = checked; if (checkbox !== undefined) change.checkbox = checkbox; if (heading !== undefined) change.heading = heading; if (color !== undefined) change.color = color; const response = await client.editDocument(documentId, [change as any]); return { content: [ { type: "text", text: `Node edited successfully!\nDocument: ${documentId}\nNode: ${node_id}`, }, ], }; }