run_script
Execute Python code in a subprocess with timeout control, returning stdout, stderr, and exit code for debugging.
Instructions
Execute Python code and return the result.
Args: code: Python code to execute timeout: Execution timeout in seconds (default: 30)
Returns: JSON string with success, stdout, stderr, error, and return_code
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>"
},
"name": "run_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| timeout | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |