Skip to main content
Glama

ipynb_str_replace_in_cell

Replace a substring within a chosen cell of a Jupyter notebook (.ipynb) by providing file path, cell index, and old/new strings. Works directly on notebook files without requiring a Jupyter server.

Instructions

Replace substring within cell content in a Jupyter Notebook (.ipynb).

Args: ipynb_filepath: Path to Jupyter Notebook (.ipynb) file (absolute path preferred) cell_index: Index of cell old_str: String to replace (provide as raw string, no additional escaping needed) new_str: Replacement string (provide as raw string, no additional escaping needed)

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
new_strYes
old_strYes
cell_indexYes
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 provided, so description carries the burden. It discloses the main action and return dict, but doesn't mention in-place modification, error cases, or cell_index validity. Some transparency, but not comprehensive.

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?

Concise and well-structured: a single-sentence action followed by a clear argument list and return type. No unnecessary words.

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 description is adequate for a simple tool but lacks edge-case details (e.g., out-of-range cell_index, whether file is modified in place, exact structure of the return dict). It's more complete than a bare schema but leaves room for interpretation.

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 has no parameter descriptions, but the description compensates by explaining each arg, including helpful guidance on raw strings and no escaping needed. This adds significant value beyond the schema.

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 a specific verb ('Replace') and resource ('substring within cell content in a Jupyter Notebook'), distinguishing it from siblings like ipynb_replace_cell (whole cell replacement) and ipynb_search_replace_all (across cells).

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?

No guidance on when to use this tool vs alternatives (e.g., replace_cell, search_replace_all). It simply states the action without context 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