Skip to main content
Glama

Execute Code in Sandbox

dev.code.execute
Idempotent

Execute source code in a sandboxed environment supporting 71 programming languages. Returns stdout, stderr, execution time, and memory usage with CPU/memory limits.

Instructions

⚡ ACTION: Execute source code in a sandboxed environment — 71 programming languages supported (Python, JavaScript, Java, C++, Go, Rust, C#, Bash, Ruby, PHP, and 60+ more). Returns stdout, stderr, execution time, and memory usage. Safe sandboxed execution with CPU/memory limits. Use code.languages to get language IDs (Judge0 CE)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
language_idYesLanguage ID from code.languages (e.g. 71=Python 3, 63=JavaScript, 62=Java, 54=C++, 60=Go, 73=Rust, 51=C#, 46=Bash). Call code.languages for full list
source_codeYesSource code to execute
stdinNoStandard input to feed to the program
cpu_time_limitNoCPU time limit in seconds (default 5, max 15)
memory_limitNoMemory limit in KB (default 128000 = 128MB)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultNoTool response payload. Shape varies per tool — consult the tool description and inputSchema. May be an object, array, string, or number depending on the upstream provider response.
errorNoPresent only when the call failed. Includes error code, message, request_id, and any provider-specific extras.
Behavior5/5

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

The description discloses execution behavior: sandboxed, CPU/memory limits, returns stdout/stderr/execution time/memory. Annotations (idempotent, not read-only) are consistent and description adds context beyond them.

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 description is concise and front-loaded with the action verb and key features. It includes an emoji and essential details without unnecessary fluff, though it could be slightly more compact.

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?

Given the tool's complexity and the presence of a full output schema, the description covers the necessary aspects: purpose, supported languages, safety, output metrics, and reference for language IDs. It is complete for an execution tool.

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 provides 100% coverage with detailed descriptions for all 5 parameters. The description adds no additional parameter information beyond what the schema already provides, warranting the baseline score of 3.

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 clearly states the tool executes source code in a sandboxed environment, listing 71 supported languages and output types. It distinguishes itself from sibling 'dev.code.languages' by referencing it for language IDs.

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 explains when to use the tool (execute code safely) and references a sibling tool for language ID lookup, but does not explicitly state when not to use it or mention alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/whiteknightonhorse/APIbase'

If you have feedback or need assistance with the MCP directory API, please join our Discord server