execute_code
Execute code directly in Jupyter notebooks for debugging, profiling, and temporary calculations without saving to the notebook.
Instructions
Execute code directly in the kernel (not saved to notebook) on the current activated notebook.
Recommended to use in following cases:
1. Execute Jupyter magic commands(e.g., `%timeit`, `%pip install xxx`)
2. Performance profiling and debugging.
3. View intermediate variable values(e.g., `print(xxx)`, `df.head()`)
4. Temporary calculations and quick tests(e.g., `np.mean(df['xxx'])`)
5. Execute Shell commands in Jupyter server(e.g., `!git xxx`)
Under no circumstances should you use this tool to:
1. Import new modules or perform variable assignments that affect subsequent Notebook execution
2. Execute dangerous code that may harm the Jupyter server or the user's data without permission
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Code to execute (supports magic commands with %, shell commands with !) | |
| timeout | No | Execution timeout in seconds |