Skip to content

Commit 5a25a91

Browse files
fix the wrong type (#144)
1 parent 40769e6 commit 5a25a91

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

jupyter_mcp_server/tools/execute_cell_tool.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,14 @@ async def execute(
192192
cell_id = ydoc.ycells[cell_index].get("id")
193193
cell_source = ydoc.ycells[cell_index].get("source")
194194

195-
if not cell_source or not cell_source.to_py().strip():
195+
if isinstance(cell_source, str):
196+
code_to_execute = cell_source
197+
else:
198+
code_to_execute = cell_source.to_py()
199+
200+
if not code_to_execute or not code_to_execute.strip():
196201
return []
197202

198-
code_to_execute = cell_source.to_py()
199203
document_id = f"json:notebook:{file_id}"
200204

201205
# Execute with RTC metadata - outputs will sync automatically

0 commit comments

Comments
 (0)