add_code_cell
Insert a code cell at a given index in a Colab notebook, shifting existing cells, and return the new cell ID.
Instructions
Inserts a code type cell at the provided index and shifts existing cells. The resulting new cell id is returned.
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": {
"cellIndex": "<cellIndex>",
"language": "<language>",
"code": "<code>"
},
"name": "add_code_cell"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cellIndex | Yes | The index at which to insert the cell. | |
| language | Yes | The programming language of the new cell. | |
| code | Yes | The code content of the new cell. |