execute_code
Execute Wolfram Language code for computation and plotting, with support for compute, notebook, and interactive output styles.
Instructions
[PRIMARY] Execute Wolfram Language code. Prefer this for nearly all computation and plotting.
Choose a style:
style="compute"— fast kernel evaluation, result in chatstyle="notebook"— evaluate in kernel, show in notebook cellstyle="interactive"— front-end evaluation (required for Manipulate/Dynamic)
style is a high-level preset for output_target + mode. Individual params still
work and override style. When style and output_target are both omitted,
output_target defaults to the profile's default (notebook)
and mode defaults to kernel.
response_detail accepts the canonical levels compact, standard, verbose,
and diagnostic, plus the aliases short, medium, and long.
Prefer this over write_cell + evaluate_cell for running code.
With output_target="notebook", it reuses the active notebook (or creates one
if none exists), writes the code, and evaluates it in one call.
If notebook transport fails, the request returns a notebook-targeted error
instead of silently rerunning through CLI fallback.
NOTE: if the user asks for a NEW notebook, call create_notebook first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| format | No | text | |
| output_target | No | ||
| mode | No | ||
| style | No | ||
| response_detail | No | standard | |
| render_graphics | No | ||
| deterministic_seed | No | ||
| session_id | No | ||
| isolate_context | No | ||
| timeout | No | ||
| max_wait | No | ||
| sync | No | none | |
| sync_wait | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |