create_notebook
Generate and customize Jupyter notebooks for Python and Markdown tasks, ensuring unique names and valid JSON content for streamlined data analysis and integration with SingleStore databases.
Instructions
Create a new Jupyter notebook in your personal space. Only supports python and markdown.
Parameters:
- notebook_name (required): Name for the new notebook
- Can include or omit .ipynb extension
- Must be unique in your personal space
- content (optional): JSON object with the following structure:
{
"cells": [
{"type": "markdown", "content": "Markdown content here"},
{"type": "code", "content": "Python code here"}
]
}
- 'type' must be either 'markdown' or 'code'
- 'content' is the text content of the cell
IMPORTANT: The content must be valid JSON.
How to use:
- Before creating the notebook, call check_if_file_exists tool to verify if the notebook already exists.
- Always install the dependencies on the first cell. Example:
{
"cells": [
{"type": "code", "content": "!pip install singlestoredb --quiet"},
// other cells...
]
}
- To connect to the database, use the variable "connection_url" that already exists in the notebook platform. Example:
{
"cells": [
{"type": "code", "content": "conn = s2.connect(connection_url)"},
// other cells...
]
}
Input Schema
Name | Required | Description | Default |
---|---|---|---|
content | Yes | ||
ctx | No | ||
notebook_name | Yes |
Input Schema (JSON Schema)
{
"$defs": {
"Context": {
"description": "Context object providing access to MCP capabilities.\n\nThis provides a cleaner interface to MCP's RequestContext functionality.\nIt gets injected into tool and resource functions that request it via type hints.\n\nTo use context in a tool function, add a parameter with the Context type annotation:\n\n```python\n@server.tool()\ndef my_tool(x: int, ctx: Context) -> str:\n # Log messages to the client\n ctx.info(f\"Processing {x}\")\n ctx.debug(\"Debug info\")\n ctx.warning(\"Warning message\")\n ctx.error(\"Error message\")\n\n # Report progress\n ctx.report_progress(50, 100)\n\n # Access resources\n data = ctx.read_resource(\"resource://data\")\n\n # Get request info\n request_id = ctx.request_id\n client_id = ctx.client_id\n\n return str(x)\n```\n\nThe context parameter name can be anything as long as it's annotated with Context.\nThe context is optional - tools that don't need it can omit the parameter.",
"properties": {},
"title": "Context",
"type": "object"
}
},
"properties": {
"content": {
"title": "content",
"type": "string"
},
"ctx": {
"anyOf": [
{
"$ref": "#/$defs/Context"
},
{
"type": "null"
}
],
"default": null
},
"notebook_name": {
"title": "notebook_name",
"type": "string"
}
},
"required": [
"notebook_name",
"content"
],
"title": "create_notebookArguments",
"type": "object"
}