complete_node
Mark a node as completed in Resurgo-MCP to track progress and manage knowledge capture workflows.
Instructions
Mark a node as done
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes |
Implementation Reference
- src/nodes.ts:169-199 (registration)Registers the MCP tool 'complete_node' including input schema (nodeId: uuid), description, and handler function that calls apiClient.completeNode and formats the response.server.tool( 'complete_node', 'Mark a node as done', { state: z.object({ nodeId: z .string() .uuid() .describe('The ID of the node to mark as done'), }), }, async ({ state }) => { const result = await apiClient.completeNode(state); if (result.error) { return { content: [{ type: 'text', text: result.error }], isError: true, }; } return { content: [ { type: 'text', text: JSON.stringify(result.data, null, 2), }, ], }; }, );
- src/nodes.ts:180-198 (handler)Handler function for 'complete_node' tool: invokes apiClient.completeNode with state, handles error or success by returning text content.async ({ state }) => { const result = await apiClient.completeNode(state); if (result.error) { return { content: [{ type: 'text', text: result.error }], isError: true, }; } return { content: [ { type: 'text', text: JSON.stringify(result.data, null, 2), }, ], }; },
- src/nodes.ts:173-178 (schema)Zod input schema for the tool: requires nodeId as UUID string.state: z.object({ nodeId: z .string() .uuid() .describe('The ID of the node to mark as done'), }),
- src/api-client.ts:102-109 (helper)API client helper method: sends POST request to backend /mcp/complete-node endpoint with nodeId.async completeNode(params: { nodeId: string; }): Promise<ApiResponse<any>> { return this.request('/mcp/complete-node', { method: 'POST', body: JSON.stringify(params), }); }