craftos_write_file
Write or overwrite a Lua/text file in the workspace, creating missing folders. Use it to prepare scripts and configs for ComputerCraft programs while rejecting paths outside the workspace.
Instructions
Write a Lua/text file in the workspace, replacing any file already there and making missing folders. The workspace is copied to the root of every computer a session starts, so paths match a real deployment. Paths that leave the workspace are refused.
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": {
"path": "<path>",
"content": "<content>"
},
"name": "craftos_write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Workspace-relative path with forward slashes, e.g. "startup.lua". | |
| content | Yes | The whole file's new text. |