🤖 MCP tools
bash
Execute a shell command inside the sandbox.
Parameters:
sandbox(string, required) Sandbox name.command(string, required) Shell command to execute.workdir(string, optional) Working directory inside the sandbox.timeout(integer, optional) Timeout in seconds.
glob
Find files matching a glob pattern.
Parameters:
sandbox(string, required) Sandbox name.pattern(string, required) Glob pattern to match.path(string, optional) Base path for matching.
grep
Search file contents for a pattern.
Parameters:
sandbox(string, required) Sandbox name.pattern(string, required) Pattern to search for.path(string, required) Path inside the sandbox.include(string, optional) Glob include filter (e.g., *.rs).
ls
List directory entries.
Parameters:
sandbox(string, required) Sandbox name.path(string, required) Path inside the sandbox.recursive(boolean, optional) Recursively list all descendants.
patch
Apply a unified diff inside the sandbox.
Parameters:
sandbox(string, required) Sandbox name.path(string, required) Path inside the sandbox.diff(string, required) Unified diff to apply.
read
Read a file from the sandbox.
Parameters:
sandbox(string, required) Sandbox name.path(string, required) Path inside the sandbox.offset(integer, optional) Line offset (0-based).limit(integer, optional) Maximum number of lines to read.
sandbox-create
Create a new sandbox based on the current repository HEAD.
Parameters:
name(string, required) Sandbox name.
sandbox-ports
Get forwarded ports for a sandbox.
Parameters:
sandbox(string, required) Sandbox name.
write
Write a file into the sandbox.
Parameters:
sandbox(string, required) Sandbox name.path(string, required) Path inside the sandbox.content(string, required) Full file contents to write.
Sandbox lifecycle
A sandbox is active, paused or missing. active and paused are derived from the
sandbox's compute; missing means the record and the branch exist but the compute has
exited. Every command that takes a sandbox expects active.
Tools
| Tool | active | paused | missing |
|---|---|---|---|
bash, read, write, patch, ls, glob, grep | runs | invalid params, conflict, naming the resume command | repairs the sandbox, appends a recovery block, then runs |
sandbox-ports | the recorded ports | the recorded ports | the recorded ports |
sandbox-create | conflict | conflict | repairs the sandbox and reports the recovery |
sandbox-create on an active or paused name is a conflict. On a missing name it
repairs the compute and reports the recovery. sandbox-ports answers from the
record, so the same ports come back whether or not the compute is alive; a backend
that does not forward ports reports the operation as unsupported.
A paused command is refused before any join, so the tool returns immediately. A repaired command's result carries the normal content plus a structured recovery block naming the sandbox, the state it came from and the branch.
See Sandbox lifecycle for the state diagram, the failure classes and how to recover a missing sandbox.