Skip to main content
Glama

Edit Cell

edit_cell

Modify an existing cell's source code with a staleness check to prevent overwriting concurrent edits, requiring a prior read baseline.

Instructions

Edit an existing cell's source code.

Includes a staleness guard: unless check_fresh=False, refuses to edit a cell that has no full-source read baseline (needs_read) or whose source changed since that read (conflict). get_cell_data records the baseline; a get_cell_map preview does not. This prevents silently overwriting a concurrent edit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoOptional new cell name.
sourceYesNew source code.
cell_idYesTarget cell id.
hide_codeNoOptional new hide_code value.
server_urlNoServer URL override.
session_idNoSession ID; omit only when the active-session binding holds for this call (see `list_active_notebooks`).
check_freshNoRefuse to edit a cell that changed since last read.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.3

TDQS

A4.6/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 it well: it discloses the staleness guard, the two refusal conditions, and the purpose (preventing silent overwrite of a concurrent edit). It stops short of describing permission/auth requirements or what a successful edit returns, but the guard disclosure is substantial behavioral context.

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?

Front-loaded with the core action, then the guard explained in two tight sentences with no filler. The parenthetical callout of needs_read/conflict is economical and information-dense.

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 mutation tool with 7 params, an output schema, and full schema coverage, the description supplies the critical non-obvious behavior (the freshness guard) that the schema alone would hide. Minor gaps remain around session requirements and success semantics, but they are largely covered by structured fields.

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 coverage is 100%, so baseline is 3, but the description adds real meaning for check_fresh beyond the schema's one-liner by spelling out the two staleness failure modes. The remaining parameters (name, hide_code, source, session_id) are left entirely to 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?

States a specific verb and resource ('Edit an existing cell's source code') and implicitly separates itself from create_cell/delete_cell/run_cell. The guard discussion further delineates it by naming get_cell_data and get_cell_map as related-but-different operations, so an agent can place it precisely among siblings.

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

Usage Guidelines5/5

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

Explicitly states when the edit proceeds and when it is refused (needs_read with no read baseline, conflict when source changed), plus the check_fresh=False escape hatch. It also tells the agent how to satisfy the precondition (use get_cell_data, not a get_cell_map preview), which is genuine routing guidance.

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