Skip to main content
Glama

ipynb_replace_cells_batch

Replace multiple cells in a Jupyter Notebook at once by providing cell indices and new content in a single batch operation.

Instructions

Replace multiple cells in one operation in a Jupyter Notebook (.ipynb).

Args: ipynb_filepath: Path to Jupyter Notebook (.ipynb) file (absolute path preferred) replacements: List of dicts with 'cell_index' and 'content' keys (provide content as raw strings, no additional escaping needed)

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
replacementsYes
ipynb_filepathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses that the operation replaces multiple cells and returns a dict with 'success' and 'cells_modified' or 'error'. However, it does not note that replacements are destructive/overwrite existing content, nor does it mention any validation of cell indexes or handling of invalid inputs.

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 tightly structured with Args and Returns, each sentence contributing directly to understanding. It is brief, well-organized, and free of 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 and the presence of an output schema, the description covers the main inputs and return format. It could be more complete by specifying error cases (e.g., invalid cell index) or noting whether outputs are cleared, but it is sufficiently informative for typical batch replacement operations.

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 description significantly enriches the schema: it explains 'ipynb_filepath' as a path with 'absolute path preferred', and 'replacements' as a list of dicts with 'cell_index' and 'content' keys, advising raw strings without escaping. This is essential because the schema itself provides no descriptions (0% coverage).

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

Purpose5/5

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

The description clearly states 'Replace multiple cells in one operation in a Jupyter Notebook (.ipynb)', using a specific verb and resource. The phrase 'multiple cells in one operation' distinguishes it from the sibling tool ipynb_replace_cell, which handles single-cell replacement.

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

Usage Guidelines3/5

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

The description implies the tool is for batch replacement ('multiple cells in one operation') but does not explicitly mention when to use it over alternatives like ipynb_replace_cell or ipynb_str_replace_in_cell. It provides sufficient context for a reasonable user, but lacks explicit exclusions or alternative references.

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