{"ok":true,"site":{"host":"jtp.io","url":"https://jtp.io/jupyter-webmcp/lab/index.html","type":"live","desc":"JupyterLite","tools":[{"name":"get_context","kind":"answer","impl":"imperative","description":"Call this first. Describes this Jupyter page: the open documents (widget id, path, unsaved changes, kernel id and status, active notebook cell), the cursor and selection of the current editor, the running kernels, the file browser directory, the open dialogs and the pending tool calls. In JupyterLite, the kernels are those of this browser tab.","title":"Get the Jupyter context","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{}},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"list_all_commands","kind":"answer","impl":"imperative","description":"Find Jupyter commands, for tasks that no other tool covers. Every word of \"query\" must appear in the command id, label, caption or usage. In each result, \"args\" is the JSON schema of the arguments (not values) and \"tool\" is the dedicated tool to use instead, if any. Run commands with execute_command.","title":"List Jupyter commands","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"query":{"type":"string","description":"Words to search for, for example \"notebook run\" or \"theme\"."},"limit":{"type":"integer","description":"Maximum number of commands to return (default 50).","minimum":1}}},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"execute_command","kind":"act","impl":"imperative","description":"Run any Jupyter command by id (find ids and argument schemas with list_all_commands), for example {\"command_id\": \"apputils:change-theme\", \"args\": {\"theme\": \"JupyterLab Dark\"}}. Most commands act on the active document. To target an open notebook or console that is not active, add \"semanticWidget\": \"<widget id from get_context>\" and \"activate\": false to the args of notebook:* and console:* commands.","title":"Execute a Jupyter command","annotations":{"consequentialHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"command_id":{"type":"string","description":"The command id, for example \"notebook:run-all-cells\"."},"args":{"type":"object","description":"Arguments for the command.","additionalProperties":true}},"required":["command_id"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"answer_dialog","kind":"act","impl":"imperative","description":"Click a button of the dialog that is shown, for example to confirm a kernel restart reported by a pending result. Input fields keep their current value. Pass dialogId when several dialogs are open (shown or queued); queued dialogs cannot be answered. If the dialog opened during a tool call whose result you did not get yet, returns the result of that call (or a pending status).","title":"Answer a Jupyter dialog","annotations":{"consequentialHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"button":{"type":["string","integer"],"description":"The button label (case-insensitive), or its 0-based index."},"dialogId":{"type":"string","description":"The dialog id, only needed when several dialogs are open (see get_context)."}},"required":["button"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"wait_for_result","kind":"act","impl":"imperative","description":"Wait for a tool call that returned status \"pending\" and return its final result. If the call is still running when the wait ends, returns status \"pending\" again.","title":"Wait for a pending tool call","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"pendingId":{"type":"string","description":"The pendingId of the pending result."},"timeout":{"type":"number","description":"Maximum seconds to wait, capped to the execution timeout setting."}},"required":["pendingId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"open_document","kind":"act","impl":"imperative","description":"Show a file (notebook, text file, image...) to the user: open it in the main area, or bring its tab to the front. Not needed to read or edit files. \"factory\" picks a viewer (for example \"Editor\" to see a notebook as JSON) and \"options.mode\" a layout (for example \"split-right\"). On a page that shows one document (see get_context), the document opens in a new browser tab with its own tools, and the result has \"disposed\": true. A pop-up blocker can stop that tab: then ask the user to open the document.","title":"Open the provided `path`.","annotations":{},"inputSchema":{"type":"object","properties":{"path":{"type":"string","description":"The path of the file to open"},"factory":{"type":"string","description":"The widget factory name"},"options":{"type":"object","description":"Additional options for opening the widget","properties":{"ref":{"type":"string","description":"The reference widget id for the insert location (default `null`)"},"mode":{"type":"string","description":"The insertion mode relative to a reference widget (\"split-top\", \"split-bottom\", \"split-left\", \"split-right\", \"tab-before\", \"tab-after\")"},"activate":{"type":"boolean","description":"Whether to activate the widget (default `true`)"},"rank":{"type":"number","description":"The rank order of the widget among its siblings"},"type":{"type":"string","description":"Type of widget to open, used to load user customization (typically a factory name or widget id)"}}}},"required":["path"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"list_directory","kind":"answer","impl":"imperative","description":"List the files and folders of a directory. Paths are relative to the root of the file browser; \"\" is the root.","title":"List Directory","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"path":{"type":"string","description":"Path to the directory to list. If not provided, lists the root directory"},"includeHidden":{"type":"boolean","description":"Whether to include hidden files (default: false)"}},"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"read_file","kind":"answer","impl":"imperative","description":"Read a text file, including unsaved changes in an open editor. For notebooks, use read_notebook.","title":"Get File Info","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"filePath":{"type":"string","description":"Path to the file to read. If not provided, uses the currently active file in the editor."}},"required":["filePath"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"write_file","kind":"act","impl":"imperative","description":"Replace the whole content of an existing text file and save it. Read the file first. Use create_file for a new file, and the notebook tools for notebooks.","title":"Set File Content","annotations":{"consequentialHint":true},"inputSchema":{"type":"object","properties":{"filePath":{"type":"string","description":"Path to the file to update"},"content":{"type":"string","description":"The new content to set for the file"}},"required":["filePath","content"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"create_file","kind":"act","impl":"imperative","description":"Create a text file with optional content. \"fileName\" is a name, not a path; \"cwd\" is the directory (default: the root). Fails if the file exists.","title":"Create File","annotations":{},"inputSchema":{"type":"object","properties":{"fileName":{"type":"string","description":"Name of the file to create"},"fileType":{"type":"string","description":"Registered JupyterLab file type to create. Common examples: text, python, markdown, json, javascript, typescript, yaml, julia, r, csv"},"content":{"type":"string","description":"Initial content for the file (optional)"},"cwd":{"type":"string","description":"Directory where to create the file (optional)"}},"required":["fileName"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"create_notebook","kind":"act","impl":"imperative","description":"Create the notebook \"<name>.ipynb\" at the root with a kernel for \"language\" (the default kernel otherwise) and open it without taking the focus. Returns notebookPath. Fails if the file exists.","title":"Create Notebook","annotations":{},"inputSchema":{"type":"object","properties":{"language":{"type":"string","description":"Programming language for the notebook (for example python, r, julia, or javascript). If omitted, the default kernel is used."},"name":{"type":"string","description":"Name for the notebook file (without the .ipynb extension)"}},"required":["name"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"read_notebook","kind":"answer","impl":"imperative","description":"Read a notebook as nbformat JSON (cells with their id, type, source and outputs), including unsaved changes. The other notebook tools take the cell ids from here. Cells of notebooks older than nbformat 4.5 have no id in this result.","title":"Get Notebook Content","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"notebookPath":{"type":"string","description":"Path to the notebook file. If not provided, uses the currently active notebook"}},"required":["notebookPath"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"read_cell","kind":"answer","impl":"imperative","description":"Read one notebook cell: type, source, outputs and execution count.","title":"Get Cell Info","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"notebookPath":{"type":"string","description":"Path to the notebook file. If not provided, uses the currently active notebook"},"cellId":{"type":"string","description":"nbformat cell ID of the cell to get information for. If not provided, uses the currently active cell"}},"required":["notebookPath","cellId"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"add_cell","kind":"act","impl":"imperative","description":"Insert a cell with optional content next to \"referenceCellId\" (\"position\": below by default) and return its cellId. Without referenceCellId the cell goes next to the active cell: to append, pass the id of the last cell. A single empty first cell is replaced. Not saved: call save_notebook.","title":"Add Cell","annotations":{},"inputSchema":{"type":"object","properties":{"notebookPath":{"type":"string","description":"Path to the notebook file. If not provided, uses the currently active notebook"},"referenceCellId":{"type":"string","description":"nbformat cell ID of the reference cell. If not provided, uses the currently active cell"},"content":{"type":"string","description":"Content to add to the cell"},"cellType":{"type":"string","description":"Type of cell to add","enum":["code","markdown","raw"]},"position":{"type":"string","description":"Position relative to the reference or active cell (above or below)","enum":["above","below"]}},"required":["notebookPath"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"edit_cell","kind":"act","impl":"imperative","description":"Replace the whole source of a notebook cell (the cell type does not change). Read the cell first. Not saved: call save_notebook.","title":"Set Cell Content","annotations":{"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"notebookPath":{"type":"string","description":"Path to the notebook file. If not provided, uses the currently active notebook"},"cellId":{"type":"string","description":"nbformat cell ID of the cell to modify. If not provided, targets the currently active cell"},"content":{"type":"string","description":"New content for the cell"}},"required":["content","notebookPath","cellId"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"delete_cell","kind":"transact","impl":"imperative","description":"Delete a notebook cell. Not saved: call save_notebook.","title":"Delete Cell","annotations":{"consequentialHint":true},"inputSchema":{"type":"object","properties":{"notebookPath":{"type":"string","description":"Path to the notebook file. If not provided, uses the currently active notebook"},"cellId":{"type":"string","description":"nbformat cell ID of the cell to delete"}},"required":["cellId","notebookPath"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"run_cell","kind":"act","impl":"imperative","description":"Run a code cell in the notebook kernel and return its status and outputs, which the notebook also shows. Errors return success false with the traceback.","title":"Run Cell","annotations":{"consequentialHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"notebookPath":{"type":"string","description":"Path to the notebook file. If not provided, uses the currently active notebook"},"cellId":{"type":"string","description":"nbformat cell ID of the cell to run"}},"required":["cellId","notebookPath"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"save_notebook","kind":"act","impl":"imperative","description":"Save a notebook.","title":"Save Notebook","annotations":{},"inputSchema":{"type":"object","properties":{"notebookPath":{"type":"string","description":"Path to the notebook file. If not provided, uses the currently active notebook"}},"required":["notebookPath"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"run_code","kind":"act","impl":"imperative","description":"Run code in a running kernel and return the outputs, which no notebook shows. Kernel ids come from get_context; the kernel of an open notebook shares its variables.","title":"Execute in Kernel","annotations":{"consequentialHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"kernelId":{"type":"string","description":"The ID of the kernel to execute code in"},"code":{"type":"string","description":"The code to execute"},"stopOnError":{"type":"boolean","description":"If true, abort the execution queue on an error (default: false)"}},"required":["kernelId","code"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"interrupt_kernel","kind":"act","impl":"imperative","description":"Interrupt the code running in a kernel. Kernel ids come from get_context.","title":"Interrupt Kernel by ID","annotations":{},"inputSchema":{"type":"object","properties":{"kernelId":{"type":"string","description":"The ID of a running kernel."}},"required":["kernelId"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"},{"name":"restart_kernel","kind":"act","impl":"imperative","description":"Restart a kernel without confirmation: all its variables are lost. Kernel ids come from get_context.","title":"Restart Kernel by ID","annotations":{"consequentialHint":true},"inputSchema":{"type":"object","properties":{"kernelId":{"type":"string","description":"The ID of a running kernel."}},"required":["kernelId"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/jupyter-webmcp/lab/index.html"}],"category":"Developer Tools","favicon":"/favicons/jtp.io.png","apiSurface":"spec","toolCount":21}}