edit_and_run_cell
Edit a cell's Python code in a marimo notebook, run it, and retrieve the outputs after completion.
Instructions
Edit a cell's code and run it. Waits for completion and returns outputs.
This does NOT require --mcp flag or agent mode.
Args: notebook: Path to the notebook file or port number. cell_id: The cell ID to edit (get IDs from get_cells first). code: New Python code for the cell.
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": {
"notebook": "<notebook>",
"cell_id": "<cell_id>",
"code": "<code>"
},
"name": "edit_and_run_cell"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notebook | Yes | ||
| cell_id | Yes | ||
| code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |