Skip to main content
Glama

ck_execute_code

Run generated code in a Docker sandbox with network, filesystem, secrets, shell, and deploy denied by default. Validates source before execution and supports dry-run planning.

Instructions

Execute generated code only inside a configured non-local sandbox. Defaults to Docker, denies network/filesystem/secrets/shell/deploy, validates source first, and supports dry_run for planning.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allowed_env_varsNoList of environment variable names to expose from the host environment into the sandbox. Explicit env vars take precedence over host env vars. If empty, no host environment variables are exposed.
codeYesGenerated source code to validate and execute in the sandbox.
dry_runNoWhen true, validate and plan without executing the actual operation.
languageNoRuntime language. Defaults to javascript.
max_output_bytesNoMaximum size in bytes for captured output.
network_allowlistNo
requested_capabilitiesNo
risk_tierNoSecurity sensitivity of the task. Default: medium.
sandboxNoExecution sandbox. Local host execution is intentionally unsupported.
session_idNoUnique session identifier for correlating findings, proofs, budget, and audit trail.
task_idNo
timeout_msNoTimeout in milliseconds.
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses defaults (Docker), denies specific capabilities (network, filesystem, secrets, shell, deploy), validates source first, and supports dry_run. This is substantial behavioral context, though it omits error handling or return behavior.

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 a single sentence that conveys all critical information: target (generated code), environment (non-local sandbox, Docker default), restrictions (denies list), validation, and planning mode. Every phrase earns its place; no redundancy.

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

Completeness3/5

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

The description covers key behavioral aspects but lacks detail on output/return values, error handling, or session correlation. Since there is no output schema, the description should explain what the agent can expect after execution. The schema's max_output_bytes implies captured output, but this is not clarified.

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 75%, so baseline is 3. The description adds an overview (e.g., dry_run for planning) but does not significantly enhance individual parameter meanings beyond what the schema already provides.

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 generated code only in a sandbox (non-local, defaults to Docker). It lists key restrictions (denies network/filesystem/secrets/shell/deploy) and features (validates source first, supports dry_run). This distinguishes it from sibling management tools like ck_goal, ck_fs_read, etc.

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 implies usage for safe execution of generated code in a sandbox. It states 'only inside a configured non-local sandbox', which sets clear context. However, it does not explicitly mention when not to use it or alternatives, though siblings do not include another execution tool.

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/aryaminus/controlkeel'

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