execute_code
Run Python code in a persistent Jupyter kernel, preserving variables and imports across executions.
Instructions
Execute Python code in a persistent Jupyter kernel with maintained state.
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>",
"kernel_id": "<kernel_id>"
},
"name": "execute_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python code to execute (variables persist between executions) | |
| kernel_id | Yes | ID of the kernel to execute code in (use list_kernels to see available kernels) | |
| timeout | No | Maximum execution time in seconds |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | Yes | ||
| output | Yes | ||
| result | Yes | ||
| error | Yes | ||
| timestamp | Yes |