setup_notebook
Initialize a Jupyter notebook by creating it if needed and connecting to a specified server URL. Must be called before any other notebook operations.
Instructions
Prepare notebook for use and connect to the kernel on the user-provided server. Will create a new empty Jupyter notebook if needed on the server.
CALL THIS FIRST - This tool must be called before using other notebook tools to establish the server URL connection. All subsequent notebook operations will use the server URL stored by this tool.
This tool creates an empty notebook. To add content, use the modify_notebook_cells tool after creation:
Example usage: # Step 1: REQUIRED - Setup notebook with correct server URL setup_notebook("demo", server_url="http://localhost:9999")
# Step 2: Add cells (these now use the stored server URL automatically)
modify_notebook_cells("demo", "add_markdown", "# Title\\n\\nDescription")
modify_notebook_cells("demo", "add_code", "print('Hello World')")This tool assumes a Jupyter server is already running and accessible at the specified
server_url. It connects to this existing server to manage the notebook.
Note that notebook_path must be relative to the Jupyter server root, not an absolute filesystem path.
Args: notebook_path: Path to the notebook, relative to the Jupyter server root. server_url: Jupyter server URL (HIGHLY RECOMMENDED to specify explicitly). This URL will be stored and used for subsequent interactions with this notebook. If not provided, defaults to http://localhost:8888 which may not be correct for your setup. Common values: http://localhost:8888, http://localhost:9999, etc.
Returns
dict: Information about the notebook and status message.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notebook_path | Yes | ||
| server_url | No |