File size: 1,787 Bytes
f726fd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
"""Public tool module for clone_node."""

from __future__ import annotations

from typing import Any, Dict

from mcp_servers import filesystem as fs
from mcp_servers.server import register_tool


def clone_node(state_manager, workspace_id=None, source_node_id=None, destination_parent_node_id=None, actor_user_id=None, new_name=None, copy_permissions=False) -> Dict[str, Any]:
    return fs.clone_node(state_manager=state_manager, workspace_id=workspace_id, source_node_id=source_node_id, destination_parent_node_id=destination_parent_node_id, actor_user_id=actor_user_id, new_name=new_name, copy_permissions=copy_permissions)


register_tool(
    "clone_node",
    clone_node,
    "Copy a file or directory subtree under a destination directory while preserving content and optionally permissions.",
    {
    "type": "object",
    "properties": {
        "workspace_id": {
            "type": "string",
            "description": "Input parameter workspace_id."
        },
        "source_node_id": {
            "type": "string",
            "description": "Input parameter source_node_id."
        },
        "destination_parent_node_id": {
            "type": "string",
            "description": "Input parameter destination_parent_node_id."
        },
        "actor_user_id": {
            "type": "string",
            "description": "Input parameter actor_user_id."
        },
        "new_name": {
            "type": "string",
            "description": "Input parameter new_name."
        },
        "copy_permissions": {
            "type": "boolean",
            "description": "Input parameter copy_permissions."
        }
    },
    "required": [
        "workspace_id",
        "source_node_id",
        "destination_parent_node_id",
        "actor_user_id"
    ]
},
)