Skip to main content
Glama

execute

Run multi-step JavaScript in a sandboxed QuickJS WASM VM with shell, Python, and file operations, plus optional timeouts and output limits.

Instructions

Run multi-step JavaScript inside a sandboxed Pi 1.0 QuickJS WASM VM with Claude Code $ shell and file ergonomics. Input code is raw JavaScript (async body: top-level await & return work; no markdown fences). Optional line 1 directive: // @options: {"max_output_tokens": 4000, "timeout_ms": 60000}. Globals: $`cmd ${arg}` (.text(), .json(), .lines(), .nothrow(), .cwd(), .timeout(), .env(), $.pwsh), read(path, opts?), readJson(path), write(path, content, opts?), edit(path, oldText, newText, opts?), ls(dir?), glob(pattern, opts?), grep(pattern, opts?), bash(cmd, opts?), pwsh(cmd, opts?), python(code, opts?)/py(...), tools.(args), ALL_TOOLS, searchTools(q, opts?), describeTool(name), describeNamespace(ns), text(val), image(val), console., exit(), store(k, v)/load(k), mcp.{listServers,connect,disconnect,call,listResources,readResource}. All file/shell/mcp globals are async (always await). Only text()/console. or returned output reaches context.

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": {
      "code": "<code>"
    },
    "name": "execute"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory override (defaults to active workspace root).
codeYesRaw JavaScript script body (top-level await and return supported; no markdown fences).
timeoutMsNoExecution deadline in ms (default 60000, max 300000).
maxOutputCharsNoMax inline characters before overflowing to a temp file (default 8000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the load and does disclose key behavior: sandboxed WASM VM, async body with top-level await/return, mandatory awaiting of all file/shell/mcp globals, and the critical output rule that only text()/console.* or returned values reach context. Gaps remain on side effects (do write()/edit() mutate the real workspace persistently?), state persistence across calls via store/load, and error/timeout failure behavior.

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?

Front-loaded with the core statement (what runs, where, and the code constraint) before the reference material; there is no filler prose. The long comma-separated globals inventory is dense and hard to scan, but for a tool with this many capabilities the reference content largely earns its place.

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 an arbitrary-code-execution tool with no annotations and no output schema, the description covers execution environment, input format, output routing, and available APIs thoroughly. What it omits — persistence of filesystem/mcp side effects, cross-call state, and failure semantics — are the remaining items an agent would want.

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%, so the four parameters are already documented and the baseline is 3. The description adds marginal value by documenting an alternate line-1 `// @options` directive carrying max_output_tokens and timeout_ms, but it never explains cwd, timeoutMs, or maxOutputChars directly, and doesn't clarify how the directive interacts with the schema parameters.

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 — 'Run multi-step JavaScript inside a sandboxed Pi 1.0 QuickJS WASM VM' — and immediately scopes what the code can reach ($ shell, file helpers, tools.<name>). The mention of `tools.<name>(args)` and `searchTools(q, opts?)` implicitly distinguishes it from the search_tools sibling by showing it can call other tools rather than just find them.

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?

Usefulness is inferable from the capability list (multi-step orchestration, shell/file ergonomics, calling other tools), but there is no explicit 'use this when…' or 'prefer this over…' statement, and no when-not-to-use guidance. An agent must deduce that this is the orchestration path rather than a discovery path.

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

Deploy Server

Other Tools