Skip to main content
Glama

code-execute

Execute Python, JavaScript, or shell code in a secure sandbox with configurable timeouts and pre-configured templates.

Instructions

Execute code in a secure sandbox with pre-configured environments. Cost: 2 credits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe code to execute.
timeoutNoMax execution time (1-300s).
languageNoProgramming language.python
templateNoPre-configured environment.default

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.1

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries full burden; it does add real behavioral context by disclosing the sandbox isolation, the pre-configured environment model, and a per-call credit cost. However, it omits whether state/files persist between calls, network access rules, permission requirements, and what the call returns.

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 short, front-loaded sentences with zero filler: the capability first, then the cost. Nothing redundant and nothing buried.

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

Completeness2/5

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

For a code-execution tool with no annotations and no output schema, the description leaves major gaps: it does not describe the return shape (stdout/stderr/exit code), persistence of files across calls, or resource limits beyond the schema's timeout. An agent cannot predict the result of invoking it.

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 all four parameters are already documented in the schema, establishing the baseline of 3. The phrase 'pre-configured environments' loosely echoes the template parameter but adds no syntax or selection guidance beyond the enum values.

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?

States a specific verb and resource ('Execute code') plus the execution context ('secure sandbox with pre-configured environments'). No sibling tool overlaps with code execution, so no differentiation is needed or missing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to choose this tool versus alternatives, nor any prerequisites or exclusions. The only usage-relevant detail is the cost line ('2 credits'), which hints at budget sensitivity but does not tell an agent when invocation is appropriate.

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