code_executor
Execute Python or Node.js code snippets in a sandboxed environment for quick calculations, data transformations, and API-free logic testing with isolated execution and resource limits.
Instructions
Executes a small Python or Node.js code snippet in a sandboxed child process. Hard limits: 15 second timeout, 64 KB output cap. The snippet runs in an isolated temp file — no persistent state between calls. Ideal for quick calculations, data transformations, and API-free logic.
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_executor"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| language | Yes | The language runtime to use: 'python' or 'node'. | |
| code | Yes | The code snippet to execute. Keep it self-contained. |