Skip to main content
Glama

overwrite_cell_source

Destructive

To completely rewrite a notebook cell's code, replace its source and receive a diff of the modifications.

Instructions

Replace the entire source of a cell in the currently activated notebook. Returns a diff showing the changes made.

Use this when rewriting a cell completely. For small, targeted changes,
prefer edit_cell_source instead — it is safer for partial edits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cell_indexYesIndex of the cell to overwrite (0-based)
cell_sourceYesNew complete cell source

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYesSuccess message with diff showing changes made
Behavior4/5

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

Annotations already set destructiveHint=true. The description adds that the tool returns a diff, which is behavioral insight. However, it does not elaborate on error conditions or permissions, but given annotation coverage, it is sufficient.

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?

Very concise: two sentences for main function plus a usage guideline sentence. No redundant information, front-loaded with purpose and immediate return value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given low complexity (2 required params) and presence of output schema (noting returns a diff), the description is fully adequate. It covers what, when, and return value.

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 100%, so baseline is 3. The description does not add extra semantics beyond the schema's own parameter descriptions.

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 uses specific verb 'Replace' with resource 'cell source' and mentions it works on the 'currently activated notebook'. It distinguishes from sibling 'edit_cell_source' by stating 'entire source' vs. partial edits.

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 to use ('when rewriting a cell completely') and when not ('for small, targeted changes, prefer edit_cell_source'), providing a clear alternative.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/datalayer/jupyter-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server