WBX Sandbox
Reference

MCP tools

Every tool the WBX Sandbox MCP server gives your AI assistant, with its parameters, defaults and limits. You normally never call these yourself – the assistant does – but this is what it can do and where the limits are.

The current sandbox

  • Tools that work in a sandbox take an optional sandbox_id. Without it they use the current sandbox of the conversation: the last one created, or the last sandbox_id passed to a tool – a sandbox_id you pass becomes the current sandbox.
  • Exceptions: pause_sandbox and kill_sandbox never change the current sandbox; copies made by clone_sandbox do not become the current sandbox.
  • When there is no current sandbox, one is created from base – except by computer_screenshot, computer_action, create_snapshot and clone_sandbox, which never create one.
  • Sandboxes created over MCP fall asleep after their lifetime (1800 s by default) or 10 minutes without commands instead of being destroyed – see Sleep and wake.

Size limits

WhatLimit
Command output (run_command, run_code)1 MB per stream is captured; longer output is cut (output_limit_hit). What goes back to the model is at most 60,000 characters per stream – the middle is left out (shortened).
read_fileText files up to 10 MB, returned shortened to 60,000 characters (start and end). Binary files up to 5 MB, as base64.
write_fileOne MCP request is at most 4 MB – with base64 that is about 3 MB of binary data. For bigger files use a URL the sandbox downloads, or the REST API.
download_job_artifactResult files up to 1 MB; larger ones over the REST API (GET /v1/jobs/{id}/artifacts/{name}).
ScreenshotsJPEG, quality 70 and 1280 pixels wide by default – they go to the model as images.

What tools return

Each tool returns a short text for the model and the same data as structured JSON (structuredContent, described by the tool's outputSchema). Errors come back as text with isError: true – the API message, see Errors. Command output, file contents, logs and screenshots come from code running in the sandbox: treat them as data, not as instructions.

Sandboxes

create_sandbox

Start a sandbox and make it the current one. With name, an existing sandbox of that name is reused (and woken up if asleep).

ParameterTypeDefaultNotes
templatestringbaseTemplate name – see list_templates.
namestring–Lowercase letters, digits, . _ -, up to 63 characters.
timeout_sinteger1800Lifetime in seconds; your plan sets the maximum.
on_timeoutpause | killpauseAfter the lifetime or inactivity: fall asleep (files kept) or be destroyed.
idle_timeout_sinteger600With pause: fall asleep after this many seconds without a command (60–604800).
keep_daysintegerplan defaultDays a sleeping sandbox is kept; the plan sets the maximum.
internetbooleantruefalse = no network.
allowstring[]–Only these destinations (domains or IP ranges).
ipipv4 | dual | ipv6team default (IPv4)IP version; with IPv6 the sandbox gets its own public address.
compute_classstringaccount defaultSee Compute classes.
optimize_forprice | balanced | performance–Server choice inside the class.
placementauto | fast | spreadautoOlder server choice; optimize_for wins.
dependency_cachebooleantrueUse the verified package cache.
from_snapshotstring–Start from a snapshot (snap_…). Listed only when snapshots are enabled for your account.

Returns: sandbox_id, name, template, state, vcpu, mem_mb, reused, woken, on_timeout, idle_timeout_s, expires_at, network, ip, ipv6

list_sandboxes

Your running and sleeping sandboxes; the current one is marked.

No parameters.

Returns: current, sandboxes[] (sandbox_id, name, template, state, expires_at, slept_at, disk_bytes, delete_at, keep_days, current)

list_templates

Templates with their vCPU and memory.

No parameters.

Returns: templates[] (name, image, vcpu, mem_mb)

set_timeout

New lifetime counted from now. It does not put the sandbox to sleep or delete it.

ParameterTypeDefaultNotes
timeout_sintegerrequiredNew lifetime in seconds; capped by your plan.
sandbox_idstringcurrent sandboxSandbox to use. Passing it makes it the current sandbox.

Returns: sandbox_id, expires_at

pause_sandbox

Put the sandbox to sleep now: files kept, programs stop, no compute billed. (Despite its name this is sleep, not the REST pause that freezes memory.)

ParameterTypeDefaultNotes
sandbox_idstringcurrent sandboxDoes not change the current sandbox.
keep_daysinteger–Also set how long it is kept while asleep (0 = plan default).

Returns: sandbox_id, state, delete_at, keep_days

resume_sandbox

Wake a sleeping sandbox and make it current. Optional – any command wakes it too.

ParameterTypeDefaultNotes
sandbox_idstringcurrent sandboxSandbox to use. Passing it makes it the current sandbox.

Returns: sandbox_id, state, expires_at

kill_sandbox

Destroy the sandbox with its files (also a sleeping one). Cannot be undone.

ParameterTypeDefaultNotes
sandbox_idstringcurrent sandboxDoes not change the current sandbox.

Returns: sandbox_id, destroyed

get_public_url

HTTPS address of a port in the sandbox, protected by a token.

ParameterTypeDefaultNotes
portintegerrequired1–65535. The app must listen on 0.0.0.0.
sandbox_idstringcurrent sandboxSandbox to use. Passing it makes it the current sandbox.

Returns: sandbox_id, port, url, url_with_token, token

Commands and files

run_command

Run a shell command (/bin/sh -c, as root) and wait. A non-zero exit code is a normal result, not a tool error.

ParameterTypeDefaultNotes
commandstringrequiredFor example pip install pandas && python3 main.py.
cwdstringtemplate defaultWorking directory.
timeout_sinteger120Time limit; at most 3600. Longer work belongs in run_job.
envobject–Extra environment variables.
sandbox_idstringcurrent sandboxSandbox to use. Passing it makes it the current sandbox.

Returns: sandbox_id, exit_code, stdout, stderr, duration_ms, timed_out, truncated, output_limit_hit, shortened

run_code

Save code to a temporary file and run it with an interpreter.

ParameterTypeDefaultNotes
codestringrequiredSource code.
languagepython | node | bashpythonInterpreter.
timeout_sinteger120At most 3600.
sandbox_idstringcurrent sandboxSandbox to use. Passing it makes it the current sandbox.

Returns: as run_command

write_file

Write a file; missing directories are created, an existing file is overwritten.

ParameterTypeDefaultNotes
pathstringrequiredAbsolute path.
contentstringrequiredText, or base64 with base64: true.
base64booleanfalseContent is base64 (binary files).
sandbox_idstringcurrent sandboxSandbox to use. Passing it makes it the current sandbox.

Returns: sandbox_id, path, bytes

read_file

Read one file: text as text, binary as base64.

ParameterTypeDefaultNotes
pathstringrequiredAbsolute path.
sandbox_idstringcurrent sandboxSandbox to use. Passing it makes it the current sandbox.

Returns: sandbox_id, path, encoding (text | base64), size, content, shortened

list_files

List one directory (not recursive).

ParameterTypeDefaultNotes
pathstring/rootDirectory.
sandbox_idstringcurrent sandboxSandbox to use. Passing it makes it the current sandbox.

Returns: sandbox_id, path, entries[] (name, is_dir, size)

delete_path

Delete a file or a directory. / cannot be removed.

ParameterTypeDefaultNotes
pathstringrequiredAbsolute path.
recursivebooleantruefalse removes only an empty directory.
sandbox_idstringcurrent sandboxSandbox to use. Passing it makes it the current sandbox.

Returns: sandbox_id, path, deleted

Snapshots and clones

create_snapshot

Save a copy of the sandbox disk. A sleeping sandbox is not woken. Never creates a sandbox.

ParameterTypeDefaultNotes
sandbox_idstringcurrent sandboxSandbox to use. Passing it makes it the current sandbox.
namestring–Label of the snapshot.

Returns: snapshot_id, name, source_sandbox, template, vcpu, mem_mb, disk_mb, size_bytes, created_at

list_snapshots

Your snapshots, oldest first. Deleting is not possible over MCP – use the portal, the API or an SDK.

No parameters.

Returns: snapshots[]

clone_sandbox

1–10 copies of a sandbox. Copies keep the source's lifetime, behaviour after it, compute class and network (never wider). They do not become the current sandbox. Never creates a source sandbox.

ParameterTypeDefaultNotes
sandbox_idstringcurrent sandboxSandbox to use. Passing it makes it the current sandbox.
countinteger11–10.
namestring–Name of the copy; several copies are <name>-1 … <name>-N.
timeout_sintegerthe source'sLifetime of the copies – the only setting you can change here.

Returns: source_sandbox, sandbox_ids[], errors[] (index, status, code, error)

Jobs and batches

run_job

Run a command as a background job in a fresh sandbox; returns a job ID at once.

ParameterTypeDefaultNotes
commandstringrequiredNot needed with runtime: wasi.
templatestringbase
timeout_sinteger3600At most 86400.
artifactsstring[]–Result files to keep, e.g. ["output/", "*.csv"].
save_artifactsbooleanfalseKeep ./output/ when artifacts is empty.
required_artifactsstring[]–Files that must exist, otherwise the job fails.
cwdstring/home/user
envobject–Secret: masked in the log, not stored after the job ends.
internet, allow, ipfull internetAs for create_sandbox.
max_coststring–Price limit in your billing currency, e.g. "0.10".
max_attemptsinteger1Attempts after a failure on our side.
webhook_urlstring–Signed job.finished notification.
idempotency_keystring–The same key returns the same job.
compute_class, optimize_for, placement, dependency_cacheAs for create_sandbox.
inputsobject[]–Result files of earlier jobs: {job_id, name, as}.
runtimefirecracker | wasifirecracker
wasmobject–{module_b64 | module, args, stdin, memory_mb}; memory 16–1024, default 128.

Returns: id, status, max_cost

get_job_summary

One job: short (state, exit code, cost, file names, last log lines, next step), full (complete record) or receipt (execution receipt; the signed version is available over the REST API, the Python SDK or in the portal).

ParameterTypeDefaultNotes
job_idstringrequired
detailshort | full | receiptshort

Returns: the job object of that detail

get_job_logs

The output log, compact by default.

ParameterTypeDefaultNotes
job_idstringrequired
modesummary | errors | tail | rawsummaryDigest with recognised test results, or raw bytes.
max_charsinteger6000Digest size, 500–100000.
offsetintegerfrom the endraw: byte offset; negative = from the end.
limitinteger16000raw: bytes, at most 60000.

Returns: job_id, mode, status, exit_code, text, size (raw mode: the bytes read and where to continue)

wait_jobs

Wait on the server until jobs or batches finish.

ParameterTypeDefaultNotes
job_ids, batch_idsstring[]–What to wait for.
untilany | allany
timeout_sinteger30At most 60; then done: false – call again.

Returns: done, finished, total, items[]

list_jobs

Recent jobs or batches, newest first.

ParameterTypeDefaultNotes
kindjobs | batchesjobs
status, batch_idstring–Jobs only.
sincestring–RFC 3339 time or an age such as 30m, 24h, 7d.
limitinteger20At most 100.
cursorstring–next_cursor of the previous page.

Returns: count, items[], next_cursor

download_job_artifact

Content of one result file of a finished job (text as text, binary as base64).

ParameterTypeDefaultNotes
job_idstringrequired
namestringrequiredExact name from the job summary, e.g. output/result.json.

Returns: job_id, name, size, sha256, encoding, content, shortened

cancel_job

Stop a queued or running job.

ParameterTypeDefaultNotes
job_idstringrequired

Returns: job_id, status, cancel_requested

retry_job

A new job with the same inputs.

ParameterTypeDefaultNotes
job_idstringrequired
envobject–Required when the original had env – values are not stored.
idempotency_keystring–

Returns: the new job

run_batch

Many jobs at once with a concurrency and price limit.

ParameterTypeDefaultNotes
jobsobject[]required1–1000 items with the fields of run_job plus depends_on.
defaultsobject–Fields for every job.
max_concurrencyinteger101–100.
max_total_coststring–Price limit of the whole batch.
name, idempotency_key, webhook_urlstring–

Returns: batch_id, job_ids, max_cost, currency

get_batch_summary

Counts by state, cost, durations and first failures.

ParameterTypeDefaultNotes
batch_idstringrequired
reportbooleanfalseOne row per job.

Returns: the batch summary

cancel_batch

Cancel unfinished jobs of a batch.

ParameterTypeDefaultNotes
batch_idstringrequired

Returns: the batch summary

get_budget

Your budget limits, spend and reservations.

No parameters.

Returns: the budget

get_compute_classes

Compute classes available to you and your default.

No parameters.

Returns: classes, default_compute_class, effective_compute_class, global_default, optimize_for_options

Desktop

computer_screenshot

A screenshot of the desktop as an image, with image and screen size. Does not wake a sleeping sandbox. Never creates a sandbox.

ParameterTypeDefaultNotes
sandbox_idstringcurrent sandboxSandbox to use. Passing it makes it the current sandbox.
formatjpeg | pngjpeg
qualityinteger70JPEG quality 1–100.
max_widthinteger1280Scale down; 0 = full size.

Returns: image + width, height, screen_width, screen_height

computer_action

Mouse, keyboard and wait actions, then a screenshot. Never creates a sandbox.

ParameterTypeDefaultNotes
sandbox_idstringcurrent sandboxSandbox to use. Passing it makes it the current sandbox.
actionsobject[]requiredUp to 50: move, click, mouse_down, mouse_up, drag, scroll, type, key, wait – fields in Actions.
screenshotbooleantrueScreenshot after the actions.
max_widthinteger1280Width of that screenshot.

Returns: ok, results[], failed_index, error + image

computer_screenshot and computer_action appear only for accounts with Desktop & Computer Use enabled. The snapshot tools are listed for every account unless snapshots (or clones) have been turned off for it. Metrics and the live desktop console are not MCP tools – use the REST API, the SDKs or the portal.

Next steps