Cells

read_cell

Read a specific cell from the currently activated notebook and return it's metadata (index, type, execution count), source and outputs (for code cells)

Read a specific cell from the currently activated notebook and return it's metadata (index, type, execution count), source and outputs (for code cells)

read-only: yes

Parameters

ParameterTypeRequiredDefaultDescription
cell_indexintegeryesIndex of the cell to read (0-based)
include_outputsbooleannotrueInclude outputs in the response (only for code cells)
notebook_namestring | nullnonullTarget this specific connected notebook instead of the currently activated one. Use when multiple clients share this server, to avoid racing the shared 'current notebook' pointer. Omit to use the currently activated notebook.

Call it

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "read_cell",
    "arguments": {
      "cell_index": 0,
      "include_outputs": true,
      "notebook_name": null
    }
  }
}
result = await session.call_tool("read_cell", arguments={"cell_index": 0, "include_outputs": True, "notebook_name": None})

Source

Registered by the @mcp.tool decorator on read_cell in jupyter_mcp_server/server.py.