Skip to main content
Glama
Claude File Manager MCP

Claude File Manager MCP

by sadd11

Edit a Jupyter notebook

edit_notebook

Edits a .ipynb notebook: replaces, inserts or deletes a cell. Cell indexes are 0-based; read_file shows them. A backup is saved before editing (undo_last_change). The file must be read first.

Instructions

Edits a .ipynb notebook: replaces, inserts or deletes a cell. Cell indexes are 0-based; read_file shows them. A backup is saved before editing (undo_last_change). The file must be read first.

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": {
      "path": "<path>"
    },
    "name": "edit_notebook"
  }
}

Input Schema

NameRequiredDescriptionDefault
cellNoCell index, 0-based
modeNoreplace the cell, insert before it, or delete itreplace
pathYesNotebook path (.ipynb)
sourceNoNew cell source (required for replace and insert)
cell_typeNoType for an inserted cell (default: code)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.5.1

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does meaningful work: it discloses that 'A backup is saved before editing' and points to undo_last_change for reversal, plus the mandatory read-first prerequisite. Gaps remain around error behavior for invalid indexes and whether deletes shift subsequent cell numbering, but the destructive-safety profile is well covered.

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?

Three short sentences with zero waste: purpose first, then index convention, then safety and prerequisite. Every clause carries information an agent needs before calling a mutation tool.

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 five-parameter mutation tool with no annotations and no output schema, the definition covers purpose, index convention, prerequisites, and backup/undo recovery. It stops short of describing what the call returns (e.g., confirmation or new cell index) or failure modes, which an agent would want for verification.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents mode, cell, source, and cell_type. The description's '0-based' claim and 'read_file shows them' add a minor cross-tool hint, but requiredness for source and the insert-before semantics are left to the schema. Baseline 3 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 names a specific verb and resource ('Edits a .ipynb notebook') and enumerates the three operations ('replaces, inserts or deletes a cell'), which map directly to the mode enum. An agent can distinguish this notebook-specific editor from generic siblings like edit_file without opening the schema.

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

Usage Guidelines4/5

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

It states two concrete prerequisites: 'Cell indexes are 0-based; read_file shows them' and 'The file must be read first', which routes the agent to the read_file sibling. It does not, however, say when to prefer this over edit_file or what happens on an out-of-range index, so there are no explicit exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.