update_node
Modify node details like name and description in mcp-workflowy by specifying the node ID for accurate and efficient updates.
Instructions
Update an existing node
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | New description/note for the node | |
| name | No | New name/title for the node | |
| nodeId | Yes | ID of the node to update |
Implementation Reference
- src/tools/workflowy.ts:116-135 (handler)The handler function that implements the core logic of the 'update_node' tool. It calls `workflowyClient.updateNode` with the provided nodeId, name, description, username, and password, and returns a success or error message in MCP content format.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:104-108 (schema)Zod-based input schema defining the parameters for the 'update_node' tool: required nodeId, optional name and description.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/tools/index.ts:12-22 (registration)Registers all tools from toolRegistry, including 'update_node', with the FastMCP server using server.addTool.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 }); }); }
- src/tools/index.ts:6-9 (registration)Central tool registry that spreads in workflowyTools (containing 'update_node') for use in registration.export const toolRegistry: Record<string, any> = { ...workflowyTools, // Add more tool categories here };
- src/index.ts:14-14 (registration)Invokes tool registration upon server initialization, thereby registering 'update_node'.registerTools(server);