-
Notifications
You must be signed in to change notification settings - Fork 911
Bulk notebook state visibility for MCP tools #8269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Enrich get_lightweight_cell_map with runtime_state, has_output, and has_console_output per cell - Batch get_cell_runtime_data and get_cell_outputs to accept a list of cell_ids instead of a single cell_id
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@AlecZorab can you test this out and let us know if this feels like an improvements from this particular concern you raised. |
|
@mscolnick Alec is unable to easily access his public GitHub account right now. Do you agree with these suggestions? |
|
@nojaf thanks for getting the feedback. these sounds like great additions on top of what you have, we can add all of these. |
📝 Summary
Closes #8173
🔍 Description of Changes
AI agents working with marimo notebooks via MCP need to understand full notebook state, but the current tools require O(n) individual calls. In a 33-cell notebook, verifying state after a change can require 30+ tool calls that should be one or two.
This PR makes two changes as discussed with @mscolnick in #8173:
1. Enrich
get_lightweight_cell_mapwith runtime infoLightweightCellInfonow includes three new fields:runtime_state—"idle","running","queued", etc. (ornullif no notification yet)has_output— whether the cell has visual outputhas_console_output— whether the cell has stdout/stderrThis lets agents quickly scan all cells and decide which ones to drill into, without calling
get_cell_runtime_dataorget_cell_outputsfor every cell.2. Batch
get_cell_runtime_dataandget_cell_outputsBoth tools now accept
cell_ids: list[CellId_t]instead of a singlecell_id. Responses wrap results per cell:get_cell_runtime_datareturnsdata: list[GetCellRuntimeDataData]get_cell_outputsreturnscells: list[CellOutputData](new dataclass withcell_id,visual_output,console_outputs)Manual verification
Tested against the dataflow tutorial (43 cells) with Claude Code connected to the MCP server:
get_lightweight_cell_map: all cells returned withruntime_state,has_output, andhas_console_outputcorrectly populatedget_cell_runtime_datawith 3 cell IDs: single response with code, errors, metadata, and variables for all threeget_cell_outputswith all 43 cell IDs: single response (59K chars) with visual and console output for every cell📋 Checklist