sandbox_wire
Point a service name inside the box at your process in the box (mode box: name:port reaches targetPort) or at externalBaseUrl (mode external). Only the routing changes, so your process can already be running. With port (and targetPort) it declares a new name instead; with port and fromBox the name links to another of your boxes. With web and no mode it only marks whether a person opens the service in a browser, which gives it its own URL. With scenePaths instead of a service, the box forwards those paths on sceneUrl to externalBaseUrl, so a page it serves can call the environment's API same-origin. Returns the whole wiring table.
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": {
"id": "<id>"
},
"name": "sandbox_wire"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| env | No | With version: extra environment variables for its container, applied after the environment's settings file (a name in both takes this value). Wiring the version again replaces them. Shown in sandbox_status, so put no secrets here | |
| web | No | Mark this service as something a person opens in a browser to see the product itself, or unmark it with false. It is what gives the service its own URL (services[].url in sandbox_status) and puts the box's Use it button in their app. Set it here when the box is already running and you did not mark it at start: {service, web: true} with no mode changes only the mark, not where the service goes; with port it marks the service you declare | |
| mode | No | box: the container on the box; external: externalBaseUrl. Leave it out when you only pass web | |
| port | No | Declare this service now, on a box that is already running: the name resolves inside the box from then on and name:port reaches your process on targetPort. Without it the box only knows the names given to sandbox_start. Address ranges still have to be declared at sandbox_start | |
| fromBox | No | With port: link the name to another of your boxes instead, so name:port here reaches fromPort there. Pass it again with a different box or fromPort to re-point the link | |
| service | No | Name given to sandbox_start, or a new name when you pass port | |
| version | No | With port: run a published version (label or versionId) under this name in the running box; it starts in the background, see sandbox_status services[].run | |
| fromPort | No | With fromBox: the port in that box (default: the targetPort of its service with the same name, else port) | |
| scenePaths | No | Instead of a service: path prefixes on sceneUrl that the box forwards to externalBaseUrl, e.g. ["/api"]. A page loaded from sceneUrl can then call them same-origin, so the environment's API needs no CORS entry for the box. [] clears them | |
| targetPort | No | With port: the port your process listens on in the box (default: port). Required when port is 80 or 9095, which boxd uses itself | |
| containerPort | No | With version: the port the image listens on, when it exposes none or several |