Skip to main content
Glama

ipynb_insert_cell

Add a new cell to an existing Jupyter Notebook at a given index. Specify the notebook path, cell position, content, and cell type (code, markdown, raw) to modify the file programmatically.

Instructions

Insert new cell at specified position in a Jupyter Notebook (.ipynb).

Args: ipynb_filepath: Path to Jupyter Notebook (.ipynb) file (absolute path preferred) cell_index: Position to insert cell (0-based indexing) content: Cell content (provide as raw string, no additional escaping needed) cell_type: Type of cell ('code', 'markdown', 'raw')

Returns: Dict with 'success' and 'new_cell_count' or 'error' key

Note: Indices of cells at or after the insertion point will shift by +1

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
cell_typeNocode
cell_indexYes
ipynb_filepathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the insertion behavior, 0-based indexing, that indices shift by +1, and the return structure (dict with success and new_cell_count or error). It also notes that content requires no additional escaping. This goes beyond a simple restatement and gives the agent useful operational details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections for Args, Returns, and Note. Each sentence adds value: the main operation is stated upfront, parameters are concisely explained, return format is specified, and the index-shifting caveat is important. There is no fluff or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (file mutation, multiple parameters), the description covers the key aspects: operation, parameters, return value, and a behavioral nuance. It does not enumerate error scenarios beyond returning an 'error' key, nor does it discuss prerequisites, but it is sufficiently complete for an insert cell operation, especially with an output schema available.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema contains no descriptions for any of the 4 parameters (0% schema description coverage). The description compensates fully by explaining each parameter: absolute path preference for ipynb_filepath, 0-based indexing for cell_index, raw string handling for content, and allowed values for cell_type. This is excellent parameter-level guidance.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Insert'), a specific resource ('new cell'), and the location ('at specified position' in a Jupyter Notebook file). It is clear and distinct from sibling tools like append_cell or delete_cell, though it does not explicitly name alternatives or edge cases, so a perfect score is not warranted.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no explicit guidance on when to use this tool versus alternatives such as ipynb_append_cell or ipynb_insert_cells_batch. It does include a practical note about index shifting, which helps with usage, but it does not address tool selection or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jsamuel1/jupyter-editor-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server