Skip to main content
Glama

run_code

Run python or javascript with no outbound network. Returns stdout, stderr, exit_code, status, duration_ms, and run_id. Call keys.create once. Pass caller_key from keys.create on every later tools/call. Authorization: Bearer pf_... or the header X-Caller-Key also works. A header key is used when one is present.

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

Input Schema

NameRequiredDescriptionDefault
codeYes
filesNo
stdinNo
languageYes
timeout_sNo
caller_keyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

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 full burden and does substantial work: it discloses the network isolation constraint, enumerates the response fields (stdout, stderr, exit_code, status, duration_ms, run_id), and spells out the auth scheme and precedence rule for header vs bearer keys. It stops short of resource limits (memory/CPU), whether the run_id can be reused to retrieve prior output, or whether filesystem writes persist between calls.

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?

The structure is front-loaded and sensible: purpose first, then return values, then auth mechanics. Every sentence carries information, though the auth tail (bearer prefix, alternate header, precedence rule) is denser than the rest and could be tightened slightly.

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 annotations and no output schema, the description steps in to enumerate return fields and explain the non-obvious auth handshake, which is exactly what an agent needs to call and interpret the result. The remaining gap is the input-side semantics of files, stdin, and the fixed 30s timeout, which matter for anything beyond a trivial snippet.

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 0%, so the description must compensate for six parameters. It adds real meaning for language (the two accepted values) and caller_key (where to obtain it and how to present it), but says nothing about files, stdin, or timeout_s — the last of which is pinned to a const of 30 and therefore material to know. Coverage is partial: roughly half the parameters get explanation.

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 opening sentence names a specific verb (Run), the resource (python or javascript), and a defining constraint (no outbound network) that separates it from a network-facing sibling like read_url. An agent knows exactly what class of operation this is without opening the schema.

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 description gives procedural prerequisites — call keys.create once, then pass caller_key on every later tools/call — which is genuine guidance for getting the call to succeed. However it never says when to choose this tool over alternatives such as read_url, nor what kinds of tasks are appropriate or inappropriate for a sandboxed executor.

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.

Resources