Execute Code
execute_codeRun code snippets in Python, Node.js, or Bash to compute, transform data, or test logic. Returns exit code and captured output.
Instructions
Run a snippet of code and return its output. Use this to compute, transform data, or test logic instead of doing it in your head.
Args:
language ('python'|'node'|'bash'): Interpreter to use.
code (string): The source code. Print results to stdout.
stdin (string): Optional text piped to the program's stdin.
Returns exit code plus captured stdout/stderr. Killed after the configured timeout.
Example: { "language": "python", "code": "print(sum(range(100)))" }
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": "execute_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| language | Yes | Interpreter | |
| code | Yes | Source code to run | |
| stdin | No | Optional stdin input |