run_code
Execute code snippets directly without saving to disk for quick one-off runs. Supports Python, JavaScript, Java, C++, Go, Rust, and more.
Instructions
Execute a code snippet directly without saving to disk. Use for quick one-off runs. If you already wrote the code with write_file, use run_file instead to avoid writing twice. Supported: python, javascript, typescript, java, cpp, csharp, go, rust, ruby, php, r, kotlin, swift, matlab
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": "run_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| code | Yes | ||
| language | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |