Skip to main content
Glama
tmlksu

notebook-edit

by tmlksu

insert_cell

Insert a new cell before a specified index in a Jupyter notebook, supporting code, markdown, or raw types. Optionally include a summary and prevent overwrites with expected revision.

Instructions

Insert a new cell BEFORE index (index == cell count appends).

cell_type must be one of: code, markdown, raw. Indices are 0-based. Optionally pass summary: a short description stored in cell metadata that becomes the cell's summary in list_cells (takes precedence over any leading # comment). Set it so later list_cells calls stay informative. Optionally pass expected_rev (from notebook_rev or a prior write) to refuse the write if the file changed on disk since then. Returns the new rev.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
indexYes
sourceYes
summaryNo
cell_typeYes
expected_revNo
Behavior3/5

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

With no annotations, the description carries full burden. It explains key behaviors: insertion at index, appending when index equals count, concurrency control via expected_rev, and return value of new rev. However, it omits details like error handling, permissions, or side effects on cell ordering.

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?

Four sentences with no filler. First sentence states the primary action, second clarifies index and cell_type, third explains summary utility, fourth covers expected_rev and return. Information density is high and well-organized.

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?

For a tool with six parameters and no output schema, the description covers insertion logic, parameter details, and return value. Missing are explanations of path and source (possibly obvious), error scenarios, and response format beyond 'rev'. Overall, adequate for typical use.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate. It explains index (0-based, appending), cell_type (enum of three values), summary (purpose and precedence in list_cells), and expected_rev (optimistic locking). No extra info for path or source, but adds significant meaning to four of six parameters.

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 clearly states that the tool inserts a new cell before a given index, with appending at end. It lists valid cell types, distinguishing it from delete or edit tools. However, it does not differentiate from the sibling 'insert_cells' (for multiple cells), missing a clear sibling distinction.

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 like 'insert_cells' or 'edit_cell'. It gives parameter advice (e.g., for summary) but lacks contextual usage cues, such as prerequisites or when not to use.

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/tmlksu/nbedit-mcp'

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