Skip to main content
Glama
OnlineCompiler MCP Server

OnlineCompiler MCP Server

Official

Run Tests

run_tests

Check a program against up to 10 test cases and get an overall verdict, a 0–100 score, and per-test results, with configurable output checkers and time limits.

Instructions

Check a program against test cases and judge it like an online judge.

Takes at most 10 tests, each counting as one run. Every test runs unless the code fails to compile or the request runs out of time. Returns an overall verdict, a score from 0 to 100 and a verdict per test. time_limit is seconds per test; compiling before the run does not count against it, and Java, Groovy and F#, which compile as they start, get a start-up allowance on top of it. python-3.14 includes numpy, pandas, scipy, scikit-learn, matplotlib, seaborn, statsmodels, sympy, openpyxl, pillow, duckdb, polars, wordcloud, pgmpy and nltk, and duckdb-1.5 works like sqlite-3, so data questions can be judged with checker "rows" and shared files. Files a program writes to $OUTPUT_DIR come back on visible tests only, as metadata.

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>",
      "tests": "<tests>"
    },
    "name": "run_tests"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesThe source code to check
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. Shared by every test.
testsYesUp to 10 test cases, each {'input': stdin text, 'expected_output': text the program should print}.
checkerNoHow output is compared: trim ignores trailing whitespace (default), exact is byte for byte, tokens ignores all whitespace differences, float compares numbers within a small tolerance, rows compares lines as an unordered set (for SQL and pandas output), numbers within tolerance, table compares CSV tables with a header row by column name, rows in any order (print df.to_csv()), and table_ordered does the same with rows in order.trim
compilerYesCompiler identifier (e.g. 'python-3.14', 'gcc-15'). Use list_compilers to see all options.
time_limitNoSeconds each test may take, above 0 and at most 30. Defaults to 2.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses the 10-test cap, that each test counts as a run, that all tests run unless compilation fails or time expires, the scoring/verdict model, that compile time is not charged to time_limit and compiled languages get a start-up allowance, the preinstalled package set, and that $OUTPUT_DIR files return only on visible tests.

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 core purpose is front-loaded and nearly every sentence carries operational information. The middle sentences are dense run-ons (time_limit and the package list), and the note about $OUTPUT_DIR metadata arrives late, costing a little readability.

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?

For a six-parameter judged-execution tool with an output schema, this covers the limits, failure modes, resource environment, and checker modes that determine correct invocation. Return-value explanation is not needed given the output schema, and nothing material for correct calling is missing.

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 already 100%, so the baseline is 3, but the description adds genuine meaning: time_limit excludes compilation and gains an allowance for Java/Groovy/F#, duckdb behaves like sqlite-3 so 'rows' checking plus shared files suits data questions, and checker selection is tied to output shape. Gaps remain only at the fine-grained edge, e.g. base64 handling of files.

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?

States a specific verb and resource: 'Check a program against test cases and judge it like an online judge.' The emphasis on test cases, per-test verdicts and a 0-100 score clearly distinguishes it from a plain run_code or judge_problem sibling.

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

Usage Guidelines3/5

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

It gives a useful routing hint for one parameter ('Use list_compilers to see all options') and a niche scenario ('data questions can be judged with checker "rows" and shared files'), but never states when to choose this over run_code or judge_problem, nor any exclusions. Usage is implied rather than spelled out.

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