Skip to main content
Glama
CodeSandbox MCP Server

CodeSandbox MCP Server

by techlibs

resumeSession

Connect to an existing CodeSandbox session using its sandbox and session IDs, and create the session with optional permissions or environment variables if it is missing.

Instructions

Connect to an existing session by sandboxId + sessionId. If the session does not exist, it will be created with optional permission/env.

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>",
      "sessionId": "<sessionId>"
    },
    "name": "resumeSession"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNoOptional environment variables used if the session is created.
sandboxIdYesTarget sandbox ID that holds the session.
sessionIdYesIdentifier of the existing session to connect to.
permissionNoOptional permission if the session should be created when missing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose the important non-obvious trait that a missing session is silently created, and that permission/env only apply in that creation path. It says nothing about idempotency, error conditions (e.g. mismatched sandboxId/sessionId), or what a successful connect yields.

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 sentences, zero filler, and the core addressing scheme is front-loaded before the conditional creation behavior. Nothing could be removed without losing information.

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?

The description covers the operation, its addressing scheme, and the surprising upsert branch, which is the main risk an agent faces here. The residual gap is the return value and any failure modes, minor given there is no output schema and the parameters are fully documented.

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 coverage is 100%, so every parameter already has its own description including the creation-only semantics of permission and env. The description restates the same scoping (sandboxId + sessionId) without adding format, constraints, or interaction rules beyond the schema. Baseline 3 applies when the schema does the heavy lifting.

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?

The description gives a specific verb and resource ("Connect to an existing session") and identifies the two keying parameters, sandboxId + sessionId, so the operation is immediately recognizable. It also discloses the upsert twist, which helps separate it from createSession, though it never names that sibling explicitly.

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?

Usage is implied: call this when you already hold a sessionId and want to attach to it, rather than provisioning a new session. There is no explicit statement of when to prefer createSession or resumeSandbox, and no prerequisite guidance such as whether the caller must own the sandbox.

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