Run Python or Node.js code
code_runRun a short program in a fresh sandbox: Python 3.12 (pandas, numpy, scipy, matplotlib, openpyxl, xlsxwriter, pillow, pypdf, python-docx) or Node.js 22 (date-fns, csv-parse, csv-stringify, lodash). Files from the store are in /input (by their names); anything the program writes in its working folder comes back as new files in the store. One CPU, 1 GB of memory, no network (fetch data first with web_read or files_upload). The reply has stdout, stderr (each up to 64 KB), the exit code and the saved files. Costs $0.0001 per started second of run time, at least $0.005 a run ($0.005 for a run under 50 seconds; at most $0.031 a call); nothing if it fails.
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": {
"language": "<language>",
"code": "<code>"
},
"name": "code_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The whole program. | |
| files | No | file_ids to put in /input. | |
| stdin | No | ||
| language | Yes | ||
| timeout_seconds | No |