Skip to main content
Glama

Run tests

run_tests
Read-only

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. Changed3 schema fields changed
    • changedInput schema / properties / checker / description
      Previous value: -"How 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."New value: +"How 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."
    • changedInput schema / properties / checker / enum
      Previous value: -[
      -  "trim",
      -  "exact",
      -  "tokens",
      -  "float",
      -  "rows"
      -]New value: +[
      +  "trim",
      +  "exact",
      +  "tokens",
      +  "float",
      +  "rows",
      +  "table",
      +  "table_ordered"
      +]
    • changedInput schema / properties / files / description
      Previous value: -"Input files, up to 8 and 1,000,000 decoded bytes in total, each {'name': 'data.csv', '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."New value: +"Files 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."
  2. Changed3 schema fields changed
    • changedInput schema / properties / checker / description
      Previous value: -"How 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."New value: +"How 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."
    • changedInput schema / properties / checker / enum
      Previous value: -[
      -  "trim",
      -  "exact",
      -  "tokens",
      -  "float"
      -]New value: +[
      +  "trim",
      +  "exact",
      +  "tokens",
      +  "float",
      +  "rows"
      +]
    • addedInput schema / properties / files
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Input files, up to 8 and 1,000,000 decoded bytes in total, each {'name': 'data.csv', '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."
      +}
  3. Added

TDQS

A4/5.0
Behavior5/5

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

Annotations only declare readOnly/openWorld/destructive hints; the description adds substantial context beyond them: a hard cap of 10 tests each costing one run, the failure modes that skip remaining tests (compile error, timeout), what is returned (overall verdict, 0-100 score, per-test verdicts), how time_limit interacts with compilation and with ahead-of-time-compiling languages, and that files written to $OUTPUT_DIR come back as metadata only on visible tests. This is exactly the quota and side-effect disclosure an agent needs for a sandboxed 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?

Purpose is front-loaded and each paragraph covers a distinct concern: limits, timing, environment, output capture. The long enumeration of Python packages is dense but earns its place by telling the agent what code will run; only the trailing '$OUTPUT_DIR' sentence feels compressed to the point of ambiguity ('visible tests only' is undefined here).

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?

For a complex execution tool with 6 parameters, nested-adjacent test arrays, and an output schema, the description covers caps, timing, environment, and side effects well. The minor gap is that 'visible tests' and the run quota are referenced without defining how quota is counted or where it is visible.

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 a baseline of 3 applies, but the description adds genuine meaning: it explains that time_limit excludes compile time for Java/Groovy/F#, lists the preinstalled Python packages so the agent knows what libraries are safe to reference in code, and notes that duckdb-1.5 enables judging data questions via checker 'rows' with shared files. It stops short of clarifying test object fields (input/expected_output) beyond repeating 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 opening sentence gives a specific verb and resource: 'Check a program against test cases and judge it like an online judge', which tells an agent this is a batch test-evaluation tool rather than an editor or linter. It does not, however, distinguish itself from the sibling judge_problem or run_code, so the agent must infer the boundary from names alone.

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?

Usage is implied by the mention of test cases, verdicts, and per-test results, and it names list_compilers as the way to discover compiler identifiers. There is no explicit when-to-use-this-vs-alternatives statement, no exclusion criteria, and no prerequisites, leaving the agent to infer that run_code or judge_problem should be used in other situations.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.