Skip to main content
Glama
OnlineCompiler MCP Server

OnlineCompiler MCP Server

Official

Run Code

run_code

Execute source code in an isolated sandbox and return its output, errors, exit status, runtime, and memory, with optional input files and stdin.

Instructions

Run one program in a sandbox and return its output.

Returns output, error, status, exit_code, time (wall-clock seconds), memory and truncated. Limited to 30 seconds (or time_limit) and 512 MB RAM. To check a solution against expected outputs, use run_tests instead.

python-3.14 includes numpy, pandas, scipy, scikit-learn, matplotlib, seaborn, statsmodels, sympy, openpyxl, pillow, duckdb, polars, wordcloud, pgmpy and nltk (with WordNet, VADER and the English POS tagger data) (no network, so nothing else can be installed). Files a program writes to the directory in $OUTPUT_DIR come back in files (png, svg, csv, json and txt; up to 8 files and 2 MB): PNG charts are returned as images, and SVG, CSV, JSON and text files with their text. plt.show() saves each open figure as figure-N.png, so tutorial code returns its chart. Pass files to give the program input data or helper source files.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>",
      "compiler": "<compiler>"
    },
    "name": "run_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesThe source code to execute
filesNoFiles the program can use, up to 20 and 1,000,000 decoded bytes in total: helper source files (compiled with the program) and input data. Each {'name': 'util.py' or 'pkg/util.py', 'content': text, 'encoding': 'utf8' (default) or 'base64'}. They sit in the program's working directory, so pd.read_csv('data.csv') works.
inputNoStandard input (stdin) to provide to the program
compilerYesCompiler identifier (e.g. 'python-3.14', 'gcc-15'). Use list_compilers to see all options.
time_limitNoSeconds the run may take, above 0 and at most 30. Defaults to 30.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description does substantial work: sandboxed execution, no network so nothing can be installed, 30s/512MB caps, $OUTPUT_DIR convention, up to 8 output files at 2MB, and plt.show() saving figure-N.png. The one notable gap is side effects or persistence across runs, which is left unstated for what is an 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?

Front-loaded with purpose and constraints, then environment details and output handling, which is a sensible order with no filler sentences. The package enumeration is long but carries real information an agent needs to choose libraries; only minor tightening is possible.

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

Completeness5/5

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

There is no output schema, so the explicit enumeration of returned fields (output, error, status, exit_code, time, memory, truncated) is necessary and present, and the file-return formats are described. Combined with the sandbox constraints and no-network notice, nothing material is missing for correct invocation.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description earns more by explaining the semantic role of `files` (input data or helper source files that sit in the working directory) and by reinforcing the 30s cap on time_limit. It adds the $OUTPUT_DIR convention that the schema does not spell out, though it does not clarify `input`/stdin behavior.

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?

Opens with a specific verb and resource ('Run one program in a sandbox and return its output') and immediately distinguishes itself from run_tests for expected-output checking. An agent can tell exactly what this does and which sibling it is not.

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?

Explicitly routes the agent to run_tests when checking solutions against expected outputs, and states hard limits (30s, 512MB) that implicitly exclude long-running workloads. It does not cover when-not-to-use cases beyond that single alternative, keeping it just short of a 5.

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

Deploy Server

Other Tools