Skip to main content
Glama

Create sandbox

create_sandbox

Create a new isolated Linux sandbox (microVM) and make it the current one. Returns its ID. With a name, an existing sandbox of that name is reused (woken up if asleep) – its files survive between chats. By default the sandbox falls asleep after its lifetime or 10 minutes of inactivity: files are kept, running programs stop; the next command wakes it (a few seconds).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "create_sandbox"
  }
}

Input Schema

NameRequiredDescriptionDefault
ipNoOptional IP version: ipv4 (default), dual (IPv4 and its own public IPv6) or ipv6 (internet over IPv6 only; DNS still works). Refused if no server with IPv6 is free – never downgraded.
nameNoOptional name (lowercase letters, digits, . _ -), e.g. 'my-project'. If you already have a sandbox with this name, it is reused instead of creating a new one.
allowNoOptional: allow only these destinations (domains or IP ranges), e.g. ["pypi.org", "files.pythonhosted.org"].
internetNoInternet access (default true). false = no network, e.g. for sensitive data or untrusted code.
templateNoTemplate (default 'base' = Debian with Python 3.12).
keep_daysNoWith on_timeout 'pause': keep the sandbox this many days after it falls asleep before it is deleted (default: your plan's retention, e.g. 7 days; the plan sets the maximum). Disk of a sleeping sandbox is billed.
placementNoOptional node choice: auto (default), fast or spread.
timeout_sNoLifetime in seconds (default 1800). When it expires, the sandbox falls asleep (files kept) – or is destroyed with on_timeout 'kill'.
on_timeoutNoWhat happens after the lifetime or inactivity: pause (default) = fall asleep, files are kept for several days; kill = destroy the sandbox and its data.
optimize_forNoOptional: pick the server inside the compute class by price, balanced or performance. Never changes the class or its price.
compute_classNoOptional performance class: economy, balanced, performance or memory. Without it your account's default class is used. Never downgraded; refused if no server of the class is free.
from_snapshotNoOptional snapshot ID (snap_…): the new sandbox starts with a copy of that snapshot's disk (template and default size come from the snapshot; environment variables do not – pass what it needs).
idle_timeout_sNoWith on_timeout 'pause': fall asleep after this many seconds without any command (default 600).
dependency_cacheNoUse the node's verified package cache for pip/npm/Go (default true when enabled).

Output Schema

NameRequiredDescriptionDefault
ipNoIP version: ipv4, dual or ipv6.
ipv6NoPublic IPv6 address of the sandbox (empty without IPv6).
nameNoName of the sandbox (empty if it has none).
vcpuNoNumber of vCPUs.
stateYesState: running.
wokenYesThe reused sandbox was asleep and has been woken up (programs from before are not running).
mem_mbNoMemory in MB.
reusedYesAn existing sandbox with this name was reused instead of creating a new one.
networkNoNetwork mode: full, allowlist or none.
templateYesTemplate the sandbox was created from.
expires_atYesWhen the sandbox expires or falls asleep (RFC 3339, UTC).
on_timeoutNoWhat happens after the lifetime or inactivity: pause or kill.
sandbox_idYesSandbox ID.
idle_timeout_sNoSeconds without commands before it falls asleep (0 = default or not used).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / from_snapshot
      Added value: +{
      +  "description": "Optional snapshot ID (snap_…): the new sandbox starts with a copy of that snapshot's disk (template and default size come from the snapshot; environment variables do not – pass what it needs).",
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / keep_days
      Added value: +{
      +  "description": "With on_timeout 'pause': keep the sandbox this many days after it falls asleep before it is deleted (default: your plan's retention, e.g. 7 days; the plan sets the maximum). Disk of a sleeping sandbox is billed.",
      +  "type": "integer"
      +}
  3. First observed

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare that this is a non-read-only, non-destructive creation call; the description goes well beyond that by disclosing the sleep lifecycle, that files survive between chats, that running programs stop on sleep, and that the next command wakes it in a few seconds. That is exactly the lifecycle/reversibility context an agent needs before creating a resource.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four front-loaded sentences: create-and-return-ID first, then the reuse rule, then the sleep/default-timeout behavior. Dense and free of filler, though the sleep behavior is restated across both the description and the timeout/on_timeout schema entries, so it is slightly redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 14-parameter creation tool with an output schema and full parameter documentation, the description covers the parts an agent would otherwise get wrong: naming/reuse, and what happens at the default timeout. It is complete enough to call correctly; the remaining details are properly delegated to the schema and output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, and the description still adds meaning on top: the 'name' parameter's reuse-and-wake semantics and the consequence of the default 10-minute inactivity timeout for long-lived work. It does not restate the other 12 parameters (compute class, snapshot, network), leaving those entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Create a new isolated Linux sandbox (microVM)') and adds scope the name alone doesn't carry: it becomes the current sandbox, returns its ID, and reuses an existing sandbox when a name matches. An agent can distinguish this from siblings like clone_sandbox or resume_sandbox from the description alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear conditions: called with a name an existing same-named sandbox is reused (woken if asleep) rather than duplicated, which implicitly tells the agent when not to expect a fresh machine. It stops short of naming an explicit alternative (e.g. resume_sandbox vs. create_sandbox) or stating prerequisites, so it is strong context rather than full when/when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources