rename
Move or relocate a file or directory within a CodeSandbox sandbox filesystem to a new path by specifying source and target paths.
Instructions
Rename (move) a file or directory within the sandbox filesystem. Stateless: connects per call using sandboxId+sessionId.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sandboxId": "<sandboxId>",
"sessionId": "<sessionId>",
"from": "<from>",
"to": "<to>"
},
"name": "rename"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Target path to rename/move to. | |
| env | No | Optional environment variables if the session is created. | |
| from | Yes | Existing path to rename/move from. | |
| overwrite | No | Whether to overwrite if the target exists. Defaults to true. | |
| sandboxId | Yes | Target sandbox ID to operate on. | |
| sessionId | Yes | Session identifier to connect with. If missing in the sandbox, it will be created. | |
| permission | No | Optional permission if session needs to be created. Must allow writes. |