gradeNot graded
get_contextAnswer
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.
View tool JSON
{
"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.",
"inputSchema": {
"type": "object",
"properties": {}
},
"page": "/jupyter-webmcp/lab/index.html"
}list_all_commandsAnswer
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.
View tool JSON
{
"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.",
"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
}
}
},
"page": "/jupyter-webmcp/lab/index.html"
}execute_commandAction
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.
View tool JSON
{
"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.",
"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"
]
},
"page": "/jupyter-webmcp/lab/index.html"
}answer_dialogAction
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).
View tool JSON
{
"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).",
"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"
]
},
"page": "/jupyter-webmcp/lab/index.html"
}wait_for_resultAction
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.
View tool JSON
{
"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.",
"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"
]
},
"page": "/jupyter-webmcp/lab/index.html"
}open_documentAction
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.
View tool JSON
{
"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.",
"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
},
"page": "/jupyter-webmcp/lab/index.html"
}list_directoryAnswer
List the files and folders of a directory. Paths are relative to the root of the file browser; "" is the root.
View tool JSON
{
"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.",
"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
},
"page": "/jupyter-webmcp/lab/index.html"
}read_fileAnswer
Read a text file, including unsaved changes in an open editor. For notebooks, use read_notebook.
View tool JSON
{
"name": "read_file",
"kind": "answer",
"impl": "imperative",
"description": "Read a text file, including unsaved changes in an open editor. For notebooks, use read_notebook.",
"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
},
"page": "/jupyter-webmcp/lab/index.html"
}write_fileAction
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.
View tool JSON
{
"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.",
"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
},
"page": "/jupyter-webmcp/lab/index.html"
}create_fileAction
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.
View tool JSON
{
"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.",
"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
},
"page": "/jupyter-webmcp/lab/index.html"
}create_notebookAction
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.
View tool JSON
{
"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.",
"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
},
"page": "/jupyter-webmcp/lab/index.html"
}read_notebookAnswer
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.
View tool JSON
{
"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.",
"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
},
"page": "/jupyter-webmcp/lab/index.html"
}read_cellAnswer
Read one notebook cell: type, source, outputs and execution count.
View tool JSON
{
"name": "read_cell",
"kind": "answer",
"impl": "imperative",
"description": "Read one notebook cell: type, source, outputs and execution count.",
"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
},
"page": "/jupyter-webmcp/lab/index.html"
}add_cellAction
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.
View tool JSON
{
"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.",
"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
},
"page": "/jupyter-webmcp/lab/index.html"
}edit_cellAction
Replace the whole source of a notebook cell (the cell type does not change). Read the cell first. Not saved: call save_notebook.
View tool JSON
{
"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.",
"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
},
"page": "/jupyter-webmcp/lab/index.html"
}delete_cellSensitive Action
Delete a notebook cell. Not saved: call save_notebook.
View tool JSON
{
"name": "delete_cell",
"kind": "transact",
"impl": "imperative",
"description": "Delete a notebook cell. Not saved: call save_notebook.",
"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
},
"page": "/jupyter-webmcp/lab/index.html"
}run_cellAction
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.
View tool JSON
{
"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.",
"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
},
"page": "/jupyter-webmcp/lab/index.html"
}save_notebookAction
Save a notebook.
View tool JSON
{
"name": "save_notebook",
"kind": "act",
"impl": "imperative",
"description": "Save a notebook.",
"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
},
"page": "/jupyter-webmcp/lab/index.html"
}run_codeAction
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.
View tool JSON
{
"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.",
"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
},
"page": "/jupyter-webmcp/lab/index.html"
}interrupt_kernelAction
Interrupt the code running in a kernel. Kernel ids come from get_context.
View tool JSON
{
"name": "interrupt_kernel",
"kind": "act",
"impl": "imperative",
"description": "Interrupt the code running in a kernel. Kernel ids come from get_context.",
"inputSchema": {
"type": "object",
"properties": {
"kernelId": {
"type": "string",
"description": "The ID of a running kernel."
}
},
"required": [
"kernelId"
],
"additionalProperties": false
},
"page": "/jupyter-webmcp/lab/index.html"
}restart_kernelAction
Restart a kernel without confirmation: all its variables are lost. Kernel ids come from get_context.
View tool JSON
{
"name": "restart_kernel",
"kind": "act",
"impl": "imperative",
"description": "Restart a kernel without confirmation: all its variables are lost. Kernel ids come from get_context.",
"inputSchema": {
"type": "object",
"properties": {
"kernelId": {
"type": "string",
"description": "The ID of a running kernel."
}
},
"required": [
"kernelId"
],
"additionalProperties": false
},
"page": "/jupyter-webmcp/lab/index.html"
}