create_node
Generate a new node within the mcp-workflowy MCP server to organize and structure workflow data efficiently.
Instructions
Create a new node
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/workflowy.ts:80-99 (handler)The handler function that implements the core logic of the 'create_node' tool. It invokes workflowyClient.createNode and formats the MCP response.handler: async ({ parentId, name, description, username, password }: { parentId: string, name: string, description?: string, username?: string, password?: string }, client: typeof workflowyClient) => { try { await workflowyClient.createNode(parentId, name, description, username, password); return { content: [{ type: "text", text: `Successfully created node "${name}" under parent ${parentId}` }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error creating node: ${error.message}` }] }; } }
- src/tools/workflowy.ts:71-100 (registration)Tool object definition for 'create_node' within workflowyTools export, including description, annotations, and handler reference.create_node: { description: "Create a new node", annotations: { title: "Create a new node in Workflowy", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false }, handler: async ({ parentId, name, description, username, password }: { parentId: string, name: string, description?: string, username?: string, password?: string }, client: typeof workflowyClient) => { try { await workflowyClient.createNode(parentId, name, description, username, password); return { content: [{ type: "text", text: `Successfully created node "${name}" under parent ${parentId}` }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error creating node: ${error.message}` }] }; } } },
- src/tools/index.ts:12-22 (registration)Registers all tools from toolRegistry (including create_node) to the FastMCP server instance.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/index.ts:14-14 (registration)Invokes registerTools to register the create_node tool (among others) on the MCP server.registerTools(server);
- src/tools/index.ts:6-9 (registration)Aggregates workflowyTools (containing create_node) into the central toolRegistry.export const toolRegistry: Record<string, any> = { ...workflowyTools, // Add more tool categories here };