Run Code
run_codeExecutes code snippets in 24 languages on HackerEarth's cloud servers and returns printed output or errors. Requires HACKEREARTH_KEY; use to test code and see real output.
Instructions
Executes a snippet of code on HackerEarth's cloud servers in any of 24 languages. Use when the user wants to test code, see real output instead of predicted output, or check whether a program works. Needs the code and the language identifier, call list_languages if unsure of the exact name. Requires HACKEREARTH_KEY to be set; every run consumes the key owner's HackerEarth API quota. Returns the program's printed output and any error messages.
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>",
"language": "<language>"
},
"name": "run_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| language | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |