Skip to main content
Glama

Run Code in a Sandbox Session

session

Run a command or code in an open E2B sandbox session (started by use with action create_session, which returns a session_id). Pass session_id plus either command (a shell command) or code (+ optional language: python/javascript/bash). Returns stdout/stderr/exit_code (or the code result). The sandbox stays alive — and billed per second of uptime — until you close it; re-running reuses the SAME box, so filesystem + process state persist between calls. ALWAYS close when done.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoCode to execute (alternative to `command`).
commandNoShell command to run in the sandbox.
languageNoLanguage for `code`: python (default), javascript, or bash.
session_idYesThe session_id returned by create_session.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okNoTrue when the call succeeded.
errorNoError code/message when ok=false.
resultNoStructured result, when the runtime returns one.
stderrNoCaptured standard error.
stdoutNoCaptured standard output.
exit_codeNoProcess exit code.

TDQS

A4.5/5.0
Behavior5/5

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

It discloses significant behavioral traits beyond the annotations: the sandbox persists and is billed per second, reusing the same box preserves filesystem and process state, and the tool returns stdout/stderr/exit_code. It also warns about the cost and explicitly instructs to close when done. This is valuable context that annotations alone do not provide.

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?

The description is dense with useful information in four sentences, with the core purpose front-loaded. It uses bold for 'ALWAYS close when done' to emphasize a critical action. No unnecessary words or repetition.

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

Completeness5/5

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

Given the tool's complexity (running arbitrary code in a sandbox) and the availability of an output schema, the description is complete enough. It covers invocation, parameters, return values, state persistence, billing, and the close requirement, making it self-contained even without the output schema.

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?

The input schema already describes all four parameters clearly, including the command/code alternative and language values. The description adds no new parameter-level meaning beyond what the schema provides; it simply reiterates the same information. With 100% schema coverage, the baseline of 3 applies.

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?

The description opens with 'Run a command or code in an open E2B sandbox session', providing a clear verb, resource, and context. It explicitly distinguishes from sibling tools like `close` and `use` by referencing the session creation flow and the need to later close the session.

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?

The description gives clear context for use: pass a session_id plus either `command` or `code`, with optional language. It also explains the lifecycle (stays alive until closed) and emphasizes 'ALWAYS close when done'. However, it does not explicitly state when not to use this tool or compare it with alternatives, so it misses the 'when-not/alternatives' aspect.

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.

TDQS

A4.4/5.0
Disambiguation5/5

Each tool has a unique role: consult plans, use executes, session runs sandbox commands, close ends a sandbox session, result retrieves async job outputs, llm queries an external model, and the vaaya_* tools manage account/connection lifecycle. No two tools appear to do the same thing, even with related functions.

Naming Consistency3/5

Naming is mixed: core tools use single lowercase verbs/nouns (close, use, session, result, llm, consult), while account tools consistently use the vaaya_ prefix with snake_case (vaaya_account, vaaya_logout, vaaya_onboard, vaaya_test_connection). There's no uniform verb-noun pattern across the whole set, though the prefix helps identify account-related tools.

Tool Count5/5

Ten tools is well within the ideal 3-15 range and each earns its place by covering distinct workflows: planning, execution, sandbox management, async retrieval, LLM access, and account/connection handling. No redundancy or bloat.

Completeness4/5

The toolset covers the core lifecycle: consult to discover/plan, use to execute external capabilities, session/close for ephemeral sandboxes, result for async job completion, llm for direct model queries, and vaaya_* for account management. Minor gaps exist, like no explicit cancel action for async jobs or a direct capability listing, but consult can surface options and result handles failures, so there are no dead ends.