toggle_complete
Mark or unmark a node as complete by toggling its status in the mcp-workflowy system. Specify the node ID and the desired completion state.
Instructions
Toggle completion status of a node
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| completed | Yes | Whether the node should be marked as complete (true) or incomplete (false) | |
| nodeId | Yes | ID of the node to toggle completion status |
Implementation Reference
- src/tools/workflowy.ts:178-197 (handler)The MCP tool handler for 'toggle_complete' that calls the Workflowy client to toggle the completion status of a node.handler: async ({ nodeId, completed, username, password }: { nodeId: string, completed: boolean, username?: string, password?: string }, client: typeof workflowyClient) => { try { await workflowyClient.toggleComplete(nodeId, completed, username, password); return { content: [{ type: "text", text: `Successfully ${completed ? "completed" : "uncompleted"} node ${nodeId}` }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error toggling completion status: ${error.message}` }] }; } }
- src/tools/workflowy.ts:174-177 (schema)Zod schema defining the input parameters for the toggle_complete tool: nodeId (string) and completed (boolean).inputSchema: { nodeId: z.string().describe("ID of the node to toggle completion status"), completed: z.boolean().describe("Whether the node should be marked as complete (true) or incomplete (false)") },
- src/tools/index.ts:12-22 (registration)Function that registers all tools from toolRegistry (including toggle_complete) to the FastMCP server.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 includes toggle_complete from workflowyTools via spread operator.export const toolRegistry: Record<string, any> = { ...workflowyTools, // Add more tool categories here };
- src/index.ts:14-14 (registration)Invocation of registerTools to add toggle_complete tool to the MCP server.registerTools(server);