move_node
Reposition nodes within hierarchical plans by changing parent relationships or order positions to reorganize project structures.
Instructions
Move a node to a different parent or position
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan_id | Yes | Plan ID | |
| node_id | Yes | Node ID to move | |
| parent_id | No | New parent node ID | |
| order_index | No | New position index |
Implementation Reference
- src/tools.js:569-596 (handler)The core handler for the 'move_node' tool. It attempts to use a dedicated move endpoint via POST request, falling back to direct node update if the endpoint returns 404. Uses apiClient.axiosInstance and formatResponse.if (name === "move_node") { const { plan_id, node_id, parent_id, order_index } = args; try { // Call the move endpoint - using POST as per API definition const response = await apiClient.axiosInstance.post( `/plans/${plan_id}/nodes/${node_id}/move`, { parent_id: parent_id || null, order_index: order_index !== undefined ? order_index : null } ); return formatResponse(response.data); } catch (error) { // If endpoint still doesn't work, try updating the node directly if (error.response && error.response.status === 404) { console.error('Move endpoint not found, trying direct update'); // Fallback to updating the node's parent_id via regular update const updateResponse = await apiClient.nodes.updateNode(plan_id, node_id, { parent_id: parent_id || null, order_index: order_index !== undefined ? order_index : null }); return formatResponse(updateResponse); } throw error; } }
- src/tools.js:236-249 (registration)Registers the 'move_node' tool in the list of available tools returned by ListToolsRequestSchema, including its input schema definition.{ name: "move_node", description: "Move a node to a different parent or position", inputSchema: { type: "object", properties: { plan_id: { type: "string", description: "Plan ID" }, node_id: { type: "string", description: "Node ID to move" }, parent_id: { type: "string", description: "New parent node ID" }, order_index: { type: "integer", description: "New position index" } }, required: ["plan_id", "node_id"] } },