Skip to main content
Glama

ipynb_replace_cell

Replace the content of a specific cell in a Jupyter Notebook by supplying the notebook file path, cell index, and new content. Directly modify any cell programmatically without starting a Jupyter server.

Instructions

Replace entire cell content in a Jupyter Notebook (.ipynb).

Args: ipynb_filepath: Path to Jupyter Notebook (.ipynb) file (absolute path preferred) cell_index: Index of cell to replace new_content: New content for cell (provide as raw string, no additional escaping needed)

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cell_indexYes
new_contentYes
ipynb_filepathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Replace' which implies overwriting, but it does not disclose that existing cell content is lost, whether cell metadata is preserved, what happens with out-of-range indices, or whether the file must already exist. It only mentions the return dict with 'success' or 'error', which is minimal. For a mutation tool with no annotation context, this transparency is insufficient.

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 concise: a single sentence stating the core purpose, followed by a structured Args/Returns list. Every sentence earns its place, and the format is familiar and easy to parse. It is appropriately sized and front-loaded with the primary verb and resource.

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

Completeness3/5

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

The tool is a simple mutation with 3 required parameters and an output schema, so the description need not explain return values in detail. However, it lacks usage guidance and behavioral transparency (e.g., destructive nature, existence requirements). While the core operation is clear, the contextual completeness is adequate but not thorough enough to fully guide an agent in all relevant scenarios.

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?

The schema has zero description coverage (0%), so the description must compensate, and it does. Each parameter gets a meaningful comment: ipynb_filepath notes absolute path preference, cell_index identifies the cell to replace, and new_content clarifies that it should be a raw string with no additional escaping. This adds practical guidance beyond the bare parameter names and types. It does not go into deeper detail (e.g., encoding, negative indices), so a 4 is appropriate.

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 opens with a specific verb and resource: 'Replace entire cell content in a Jupyter Notebook (.ipynb).' This clearly distinguishes it from siblings like ipynb_insert_cell, ipynb_append_cell, ipynb_delete_cell, and ipynb_str_replace_in_cell, which target different actions (inserting, appending, deleting, or partial replacement). The scope is explicit and unambiguous.

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 usage through its core statement, but it does not explicitly state when to choose this tool over alternatives. It lacks exclusions or comparisons to sibling tools such as ipynb_str_replace_in_cell or ipynb_replace_cells_batch. The intent is clear enough for an agent to infer, but without explicit guidance, it only meets the 'implied usage' bar.

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