Run Tests
run_testsCheck 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
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The source code to check | |
| files | No | 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. | |
| tests | Yes | Up to 10 test cases, each {'input': stdin text, 'expected_output': text the program should print}. | |
| checker | No | 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. | trim |
| compiler | Yes | Compiler identifier (e.g. 'python-3.14', 'gcc-15'). Use list_compilers to see all options. | |
| time_limit | No | Seconds each test may take, above 0 and at most 30. Defaults to 2. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||