Skip to main content
Glama

notebook_edit

Destructive

Replace, insert, or delete a Jupyter notebook cell on a remote machine while preserving the rest of the file; guarded fleets require explicit user confirmation before changes.

Instructions

Replace, insert or delete a cell of a Jupyter notebook on the remote machine; the rest of the notebook is preserved. On a guarded fleet you must first ask the user and get their explicit agreement; only then set confirm to the fleet name.

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>",
      "edit_mode": "<edit_mode>"
    },
    "name": "notebook_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesPath of the .ipynb file.
fleetNoFleet name. Omit to use the default.
cell_idNoCell id (replace, delete); for insert the new cell goes after this cell, or first when omitted.
confirmNoGuarded fleets only: the fleet name, set only after the user explicitly agreed. Never set it on your own.
contextNoContext name. Omit to use the default.
cell_typeNoRequired for insert.
edit_modeYes
workspaceNoWorkspace id. Omit to use this session's workspace on the fleet.
new_sourceNoNew cell source (replace, insert).

Output Schema

NameRequiredDescriptionDefault
kindYes
mimeNo
noteNo
pathNo
sizeNo
countNo
linesNo
whereYes
sha256No
contentNo
entriesNo
new_fileNo
warningsNo
truncatedNo
workspaceYes
next_offsetNo
total_linesNo
omitted_bytesNo
written_bytesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and openWorldHint=true, so the safety profile is largely structured data. The description adds real value by disclosing that non-targeted cells survive (bounding the destructiveness) and that guarded fleets require human approval. It says nothing about failure modes, partial-edit behavior, or whether replace/insert are idempotent, which is the notable remaining gap.

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?

Two sentences with no filler: the operation and its blast radius come first, the safety gate second. Every clause carries information an agent needs before calling.

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 9-parameter destructive mutation with a rich schema and an output schema, the description covers what matters most: exactly what is mutated and what survives, plus the approval gate. Return values need not be explained given the output schema. Only the interaction between edit_mode and the optional source/cell_type fields is left entirely to the schema.

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 description coverage is 89%, so nearly every parameter is documented in the schema, including the guarded-fleet semantics of `confirm` and the positioning rule for `cell_id`. The description mostly restates the `confirm` rule already present in the schema, adding little new parameter meaning. Baseline 3 applies when the schema does the heavy lifting.

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 specific verbs (replace, insert, delete) against a specific resource (a cell of a Jupyter notebook on the remote machine) and adds a scoping guarantee that the rest of the notebook is preserved. This clearly separates it from whole-file siblings like write/edit, though it never names an alternative explicitly.

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?

Gives a concrete use context (cell-level notebook editing) and an explicit prerequisite workflow for guarded fleets: ask the user, get explicit agreement, then set `confirm`. It stops short of saying when to prefer this over editing the .ipynb via a generic file tool, and gives no guidance on choosing among edit_mode values beyond the enum names.

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