Skip to main content
Glama

notebook_edit

Edit Jupyter notebook cells safely by requiring compare-and-swap anchors; mismatches fail the request before any write.

Instructions

Edit notebook cells. Every source change requires a compare-and-swap anchor (expected_source_hash or expected_text); a mismatch fails the whole request without writing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opsYes1..32 edit ops (replace_lines, insert_lines, replace_source, insert_cell, delete_cell, move_cell, set_cell_type, clear_outputs)
pathYesNotebook path
dry_runNoCompute everything but do not write. Default false
create_backupNoDefault true
expected_content_hashNoOptional optimistic-lock hash

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose one genuinely important trait: a hash mismatch aborts the entire request atomically without partial writes. However, it says nothing about dry_run/create_backup defaults, permission needs, or concurrency scope beyond the anchor.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tight sentences, front-loaded with the action and then the critical constraint. No filler, though the anchor sentence would be stronger if it used the real parameter names.

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?

For a batch mutation tool with no annotations and no output schema, atomicity is covered well, but the description omits dry_run/backup semantics and return behavior, and it references non-existent parameters, leaving real gaps an agent must resolve from the schema alone.

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

Parameters2/5

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

Schema coverage is nominally 100% (baseline 3), but the description names 'expected_source_hash' and 'expected_text' as required anchors, neither of which exists in the schema, while the schema's actual lock parameter is 'expected_content_hash' described as merely optional. This mismatch is actively misleading about which parameter to pass and whether it is required.

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

Purpose4/5

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

States a specific verb+resource ('Edit notebook cells') that cleanly separates it from siblings like notebook_read and notebook_run. It stops short of naming the alternative tools, but the action is unambiguous.

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?

The description gives a precondition (a CAS anchor is required for source changes) but never says when to choose this tool over notebook_read/notebook_run or how to structure a batch edit. No when-not guidance or alternative routing is present.

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