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.
| Capability | workspace.copy_file |
|---|---|
| Area | Workspace and files |
| Access | changes files |
| Reaches | — |
| Rights | write |
| Dry run | dry_run, on unless the call turns it off |
Arguments
| Argument | Type | Description |
|---|---|---|
path | string | Workspace-relative path of the file or folder.default "" |
paths | array of string | Several workspace-relative paths instead of path (SPEC-0275 v3); all are checked first,
each keeps its name or gets a free one.default [] |
target_dirrequired | string | Workspace-relative folder to copy it into ("" or "." for the workspace folder); must exist. |
new_name | string | Name of the copy (default: the same name). |
dry_run | boolean | Only 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.
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" ] } }}