Skip to main content
Glama

execute_code_stream

Execute code and stream progress and partial output as it runs, with an extended timeout for long-running tasks.

Instructions

Execute code and STREAM progress + partial output as it runs.

Unlike execute_code (which returns only at exit), this reports progress notifications to the client while the program runs, so agents can see output before the process finishes. Returns the same result shape and applies the SAME ceilings: max_memory_mb, max_output_kb and max_cpu are forwarded to the executor exactly as execute_code forwards them.

One difference, deliberate: the wall-clock cap is 300s here against execute_code's 120s, because streaming exists for runs long enough to want progress.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
stdinNo
no_netNo
max_cpuNo
timeoutNo
languageYes
providerNo
max_memory_mbNo
max_output_kbNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed12 schema fields changedv0.2.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / code / title
      Added value: +"Code"
    • addedInput schema / properties / language / title
      Added value: +"Language"
    • addedInput schema / properties / max_cpu
      Added value: +{
      +  "default": 0,
      +  "title": "Max Cpu",
      +  "type": "integer"
      +}
    • addedInput schema / properties / max_memory_mb
      Added value: +{
      +  "default": 0,
      +  "title": "Max Memory Mb",
      +  "type": "integer"
      +}
    • addedInput schema / properties / max_output_kb / title
      Added value: +"Max Output Kb"
    • addedInput schema / properties / no_net / title
      Added value: +"No Net"
    • addedInput schema / properties / provider
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Provider"
      +}
    • addedInput schema / properties / stdin / title
      Added value: +"Stdin"
    • addedInput schema / properties / timeout / title
      Added value: +"Timeout"
    • addedInput schema / title
      Added value: +"execute_code_streamArguments"
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden, and it does well: it discloses streaming behavior, identical result shape and ceilings for max_memory_mb, max_output_kb, and max_cpu, and the 300s vs 120s timeout difference. It stops short of describing the exact progress event shape, but the disclosed behavior materially exceeds what the schema alone would provide.

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 efficiently structured: the purpose and key distinction are front-loaded, followed by behavior and the deliberate timeout caveat. Every sentence earns its place, and there is no redundant restating of the input schema.

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?

The description covers the essential operational context: streaming, same result shape as execute_code, forwarded limits, and the timeout deviation. The main gaps are the absence of a progress-event format and sparse per-parameter semantics, but for selecting and invoking the tool the description is largely sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% for 9 parameters, so the description must compensate. It adds meaning for the execution-limit parameters (max_memory_mb, max_output_kb, max_cpu, and the timeout cap) but leaves code, language, stdin, no_net, and provider undefined. This partial coverage is insufficient for a schema with zero inline parameter documentation.

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 uses a specific verb-resource pair ('Execute code and STREAM progress') and immediately distinguishes this from execute_code, which returns only at exit. An agent can tell exactly what this tool does and how it differs from the closest sibling.

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

Usage Guidelines5/5

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

It explicitly names execute_code as the alternative and gives the decision condition: use this tool when you want progress and partial output before the process finishes. The wall-clock timeout difference also helps agents choose based on expected run duration.

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

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/The-40-Thieves/codecalc'

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