Execute Python, JavaScript or Bash in an isolated sandbox. Returns stdout, stderr and exit code. Network access is disabled. Use for data analysis, algorithm testing and calculations too complex for the calculator tool.
Input Parameters
Parameter
Type
Description
coderequired
string
Source code to execute.
languageoptional
string
Runtime to use: "python", "javascript", or "bash". Default: "python".
stdinoptional
string
Input passed to the program via stdin.
timeout_secondsoptional
integer
Execution timeout in seconds. Default: 10, max: 60.
packagesoptional
array
Python pip packages to install before running (e.g. ["pandas", "numpy"]). Only applies when language="python".
Output Fields
Field
Type
Description
stdout
string
Standard output produced by the program.
stderr
string
Standard error output. Non-empty on warnings or errors.
exit_code
integer
Process exit code. 0 indicates success.
elapsed_ms
integer
Wall-clock execution time in milliseconds.
truncated
boolean
true if stdout or stderr was truncated due to output size limits.