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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"ipynb_filepath": "<ipynb_filepath>",
"cell_index": "<cell_index>",
"old_str": "<old_str>",
"new_str": "<new_str>"
},
"name": "ipynb_str_replace_in_cell"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new_str | Yes | ||
| old_str | Yes | ||
| cell_index | Yes | ||
| ipynb_filepath | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||