Skip to main content
Glama
aliyun-agent-sandbox-mcp

aliyun-agent-sandbox-mcp

Execute code in the sandbox

run_code
Destructive

Executes Python, JavaScript, TypeScript, Bash, R, or Java code in a sandbox Jupyter kernel and returns stdout, stderr, rich results, and error tracebacks so you can test code safely.

Instructions

Execute Python/JavaScript/TypeScript/Bash/R/Java in the sandbox Jupyter kernel and return stdout, stderr, rich results and any error traceback. Requires a code-interpreter template. When sandbox_id is omitted a temporary sandbox is created and killed afterwards.

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": "run_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesSource code to execute.
languageNoExecution language, defaults to "python".
sandbox_idNoReuse this sandbox instead of creating a temporary one.
timeout_msNoSandbox TTL in milliseconds. Defaults to SANDBOX_TIMEOUT_MS (300000 = 5 minutes).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, so arbitrary code execution is signalled; the description adds real value by naming the return payload (stdout, stderr, rich results, traceback) and the implicit lifecycle side effect of spawning and killing a temporary sandbox. It does not disclose network access, filesystem persistence across reused sandboxes, or what happens when timeout_ms elapses mid-execution.

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 the capability and return shape front-loaded and the lifecycle caveat immediately after. Every clause carries information; there is no filler or redundancy.

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?

With no output schema, the description correctly takes on the burden of describing return values, and it covers the template precondition and temporary-sandbox lifecycle for a four-parameter tool with one side-effecting default. Remaining gaps (timeout expiration behavior, whether a reused sandbox retains files, network egress) are minor but non-trivial for a code-execution tool.

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 the baseline is 3; the description earns a bump by explaining that omitting sandbox_id creates and then destroys a temporary sandbox, which the schema only hints at with "instead of creating a temporary one." It adds nothing for timeout_ms and only restates the language list already enumerated in the schema.

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 (Execute) plus resource (code) and scopes it precisely: a sandbox Jupyter kernel with an enumerated list of supported languages. It differs from sandbox lifecycle siblings by naming the execution surface, though it never explicitly contrasts itself with run_command, leaving that boundary to inference.

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 a concrete precondition ("Requires a code-interpreter template") and states the sandbox_id decision rule: omit it and a temporary sandbox is created and killed afterwards. It stops short of saying when to prefer this over run_command or when to pre-create a sandbox with sandbox_create for reuse.

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