Skip to main content
Glama

update_node

Modify an existing node's name and description in mcp-workflowy by providing the node ID and new content values.

Instructions

Update an existing node

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesID of the node to update
nameNoNew name/title for the node
descriptionNoNew description/note for the node

Implementation Reference

  • The MCP tool handler for 'update_node', which authenticates via credentials if provided, calls the underlying workflowyClient.updateNode method, and returns success/error messages.
    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}`
          }]
        };
      }
  • Zod-based input schema defining 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:6-9 (registration)
    Central tool registry that includes all workflowyTools (including update_node) via spread operator.
    export const toolRegistry: Record<string, any> = {
      ...workflowyTools,
      // Add more tool categories here
    };
  • Underlying helper method in WorkflowyClient that locates the node by ID, updates name and/or description if provided, and saves the document changes.
    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 = doc.root.items.find(item => item.id === 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();
        }
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/danield137/mcp-workflowy'

If you have feedback or need assistance with the MCP directory API, please join our Discord server