CorefinityCorefinityDocs
Open the Control PanelControl Panel
Files · 3 of 3

corestack_file_write

Write a file.

Scope execNo secrets returned
On this page

When to use it

Write one file of the environment atomically (at most 1 MiB; base64 for binary). Pass expected_sha256 (or "absent" for a new file) to write only over the content you read: a different file answers content_changed. A link (e.g. a Git-mode shared wp-config.php) is followed and kept. The guarantee holds between MCP writes; other writers are detected only through expected_sha256.

Ask for it

Prompt
Using the Corefinity MCP server, call corestack_file_write with site_id 4211, path /var/www/example.co.uk/htdocs/robots.txt, content User-agent: *
Disallow:
. (Write a file.) Tell me what it returned.

Inputs

contentstringRequired

Up to 8,388,608 characters.

create_dirsboolean

Defaults to false.

encodingstring

Defaults to utf-8.

utf-8base64
expected_sha256string

The SHA-256 of the file you read, or "absent". Up to 64 characters.

modestring

Octal, e.g. 0644. Default: the existing file's, else 0644. Up to 4 characters.

pathstringRequired

Up to 1,024 characters.

site_idintegerRequired

At least 1.

Example call

tools/call
{
  "name": "corestack_file_write",
  "arguments": {
    "site_id": 4211,
    "path": "/var/www/example.co.uk/htdocs/robots.txt",
    "content": "User-agent: *\nDisallow:\n"
  }
}

If it is refused

ReasonWhat to do
content_changedcorestack_file_write's expected_sha256 no longer matches the file; read the file again and decide.
busyAnother change is running on this row; wait for it (corestack_site_operation_get) and call again.
ended_without_statusAn MCP command exited non-zero — any non-zero exit of a payload that was started, 125 included — ran out of time, ended without a status, or lost its container; status and exit code in details; read the output (corestack_command_output_get).
managed_elsewhereAnother control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
invalid_argumentsThe arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again.
tenant_mismatchThe object does not exist or the token may not see it. Check the id.
scope_requiredThe token lacks a scope this call needs. Open the link in the answer to add it, then call again.
pin_refusedThe grant is limited to chosen clusters, sites or environments, and this call is outside them. Open the link in the answer to widen it.
rate_limitedToo many calls. Wait for the number of seconds the answer names.
temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
internal_errorSomething went wrong on our side. Quote the trace id to support.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT