get_sandbox
Get a sandbox: its state (starting, ready, stopping, stopped or failed) and, while it's ready, a fresh cdp_url. While it's starting, it waits up to 45 seconds for it to be ready before answering, with wait over REST and always over MCP: if it's still starting, call again right away, with no pause.
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": {
"sandbox_id": "<sandbox_id>"
},
"name": "get_sandbox"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wait | No | Answer once it's ready (or failed), waiting up to 45 seconds, instead of at once. | |
| sandbox_id | Yes | The sandbox, `sbx_…`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | `sbx_…`. | |
| error | No | Why it failed. | |
| state | Yes | `starting`, `ready`, `stopping`, `stopped` or `failed`. | |
| folder | Yes | The folder its recordings and screenshots go in. | |
| region | Yes | The region it runs in. | |
| cdp_url | No | While it's ready: the browser's DevTools websocket, for Playwright's `connectOverCDP`, Puppeteer's `connect` or any CDP client. It opens connections until `cdp_url_expires_at`; a connection stays open until the sandbox stops. Get the sandbox again for a fresh one. | |
| timeout | Yes | Seconds it runs before it stops itself. | |
| viewport | Yes | The browser window. | |
| created_at | Yes | RFC 3339. | |
| project_id | Yes | The project its recordings and screenshots go in. | |
| started_at | No | RFC 3339: when its browser was ready. | |
| stopped_at | No | RFC 3339. | |
| stop_reason | No | Once it's stopping: `requested` or `timeout`. | |
| cdp_url_expires_at | No | RFC 3339. |