Skip to content

copy_file

MCP tools › Workspace and files

Copy a workspace file or folder into a workspace folder, as Copy and Paste in the project tree do: folders with everything in them, links as links. Never overwrites: an existing name is an error, and the dry run proposes a free name (a_copy.txt). A folder into itself is refused. dry_run defaults to true and reports the target, the number of files and folders and free_name; dry_run=false copies and records the new files in the Local History under a label. paths instead of path copies several items: all are checked first and nothing is written if one fails; each keeps its name or gets a free one; results per item.

Capabilityworkspace.copy_file
AreaWorkspace and files
Accesschanges files
Reaches—
Rightswrite
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
pathstringWorkspace-relative path of the file or folder.default ""
pathsarray of stringSeveral workspace-relative paths instead of path (SPEC-0275 v3); all are checked first, each keeps its name or gets a free one.default []
target_dirrequiredstringWorkspace-relative folder to copy it into ("" or "." for the workspace folder); must exist.
new_namestringName of the copy (default: the same name).
dry_runbooleanOnly report what would be copied (default true).

Call it from a shell

ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.

Terminal window
ferris-idea call ~/my-project copy_file '{"target_dir":"<string>"}'
Input schema as JSON
{
"type": "object",
"required": [
"target_dir"
],
"properties": {
"path": {
"description": "Workspace-relative path of the file or folder.",
"type": "string",
"default": ""
},
"paths": {
"description": "Several workspace-relative paths instead of `path` (SPEC-0275 v3); all are checked first,\neach keeps its name or gets a free one.",
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"target_dir": {
"description": "Workspace-relative folder to copy it into (\"\" or \".\" for the workspace folder); must exist.",
"type": "string"
},
"new_name": {
"description": "Name of the copy (default: the same name).",
"type": [
"string",
"null"
]
},
"dry_run": {
"description": "Only report what would be copied (default true).",
"type": [
"boolean",
"null"
]
}
}
}