Skip to main content
Glama
hypen-code

MCE — MCP Code Execution

by hypen-code

Execute Code

execute_code

Run restricted Python code in a sandbox, pass structured inputs, and retrieve results via MCP call_tool without host filesystem or network access.

Instructions

Run restricted Python with inputs, result, and await call_tool("server.function", args).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesPython program assigning result; no host filesystem or network access.
inputsNoStructured dynamic values available as inputs inside the VM.
descriptionYesGeneric reusable operation description, without input values.
input_schemaNoOptional JSON Schema constraining inputs for execution and reuse.
idempotency_keyNoOptional owner-scoped deduplication key, not write approval.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations only provide readOnlyHint:false, so the description adds value by stating the Python environment is restricted and that call_tool is available for server function calls. However, it does not disclose potential side effects, failure modes, or execution limits, which are relevant for a code-execution tool.

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 definition is a single compact sentence that leads with the core action and includes the distinctive tool-call capability. It is efficient, though the phrase 'with inputs, result' is telegraphic and slightly awkward.

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?

With an output schema present and complete parameter documentation, most invocation details are already covered. However, the description omits usage guidance relative to sibling tools and leaves side-effect semantics implied rather than explicit, making it adequate but not complete for reliable selection.

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 of the five parameters, so the baseline is 3. The description's references to 'inputs' and 'result' loosely align with the inputs and code parameters, but it does not add meaningful detail beyond 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?

The description clearly states the tool runs restricted Python and mentions the distinctive capability to await call_tool for invoking server functions. It names a specific verb and resource, though it does not explicitly contrast itself with siblings like run_cached_code or submit_code.

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?

The description gives no guidance about when to use execute_code versus alternatives such as run_cached_code or submit_code. It does not state any conditions or exclusions, leaving tool selection to inference.

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