update_node
Update an existing Workflowy node by specifying its ID to modify its title or description.
Instructions
Update an existing node
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | ID of the node to update | |
| name | No | New name/title for the node | |
| description | No | New description/note for the node |
Implementation Reference
- src/tools/workflowy.ts:109-143 (handler)The tool handler definition for 'update_node'. It defines the inputSchema (nodeId required, name and description optional), annotations, and the handler function that calls workflowyClient.updateNode().
update_node: { description: "Update an existing node", inputSchema: { nodeId: z.string().describe("ID of the node to update"), name: z.string().optional().describe("New name/title for the node"), description: z.string().optional().describe("New description/note for the node") }, annotations: { title: "Search nodes in Workflowy", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false }, handler: async ({ nodeId, name, description, username, password }: { nodeId: string, name?: string, description?: string, username?: string, password?: string }, client: typeof workflowyClient) => { try { await workflowyClient.updateNode(nodeId, name, description, username, password); return { content: [{ type: "text", text: `Successfully updated node ${nodeId}` }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error updating node: ${error.message}` }] }; } } }, - src/tools/workflowy.ts:111-115 (schema)Input schema for update_node: requires nodeId (string), optional name (string), optional description (string).
inputSchema: { nodeId: z.string().describe("ID of the node to update"), name: z.string().optional().describe("New name/title for the node"), description: z.string().optional().describe("New description/note for the node") }, - src/workflowy/client.ts:144-162 (helper)The WorkflowyClient.updateNode() method implementation. Finds the node by ID using findNodeById, sets name/description if provided, and saves the document if dirty.
async updateNode(nodeId: string, name?: string, description?: string, username?: string, password?: string) { const { wf } = await this.createAuthenticatedClient(username, password); const doc = await wf.getDocument(); const node = this.findNodeById(doc.root, nodeId); if (!node) { throw new Error(`Node with ID ${nodeId} not found.`); } if (name !== undefined) { node.setName(name); } if (description !== undefined) { node.setNote(description); } if (doc.isDirty()) { // Saves the changes if there are any await doc.save(); } } - src/tools/index.ts:6-9 (registration)The toolRegistry object that spreads workflowyTools (including update_node) to register all tools.
export const toolRegistry: Record<string, any> = { ...workflowyTools, // Add more tool categories here }; - src/tools/index.ts:12-22 (registration)The registerTools function that iterates over the registry and calls server.addTool() for each tool (including update_node).
export function registerTools(server: FastMCP): void { Object.entries(toolRegistry).forEach(([name, tool]) => { server.addTool({ name, description: tool.description, parameters: z.object(tool.inputSchema), annotations: tool.annotations, execute: tool.handler }); }); }