Skip to main content
Glama
CodeSandbox MCP Server

CodeSandbox MCP Server

by techlibs

createSession

Creates a CodeSandbox session for a target sandbox and returns a session ID without storing state on the server. Use it to inject environment variables, Git identity, and read/write permissions.

Instructions

Create a CodeSandbox session for a sandbox. Returns the sessionId without storing state on the server.

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": {
      "sandboxId": "<sandboxId>"
    },
    "name": "createSession"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNoEnvironment variables to inject into the session (key-value map).
gitNoOptional Git identity/settings for the session.
sandboxIdYesTarget sandbox ID where the session will be created.
sessionIdNoOptional session identifier. If omitted, a UUID will be generated.
permissionNoSession permission. Use 'read' for non-mutating access, 'write' to allow edits.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It does disclose two useful traits: it returns the sessionId and stores no state server-side, but it says nothing about authentication needs, session lifetime, whether the session must later be resumed, or how permission levels affect behavior.

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

Conciseness5/5

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

Two tight sentences with no wasted wording; the creation action is front-loaded and the return-value note follows immediately.

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 five-parameter creation tool with a nested git object and no output schema, the description covers the core action and return value, with schema coverage filling in the parameters. The main omission is session lifecycle context, such as how this relates to resumeSession.

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

Parameters3/5

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

Schema description coverage is 100%, including the git nested object and the read/write permission enum, so the schema already does the explaining. The description adds no parameter detail beyond the implied sandboxId target, making the baseline 3 appropriate.

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

Purpose4/5

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

Uses a specific verb and resource ('Create a CodeSandbox session') and names the target ('for a sandbox'), which is enough to separate it from createSandbox. It stops short of explicitly contrasting itself with resumeSession, so it is clear but not fully differentiated.

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

Usage Guidelines3/5

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

The phrase 'for a sandbox' implies an existing sandbox ID is a prerequisite, but there is no explicit statement of when to call this instead of resumeSession or createSandbox, and no exclusion guidance.

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