Read and edit TileMapLayer cells
godot_tilemapRead and edit TileMapLayer cells directly in .tscn scene files without Godot, validating source and atlas coordinates and previewing changes before writing.
Instructions
The cells of a TileMapLayer node, read from and written to the scene file (Godot 4.3+; no Godot needed). A text editor cannot do this: the cells are packed bytes. op read: the used area, a map with one character per tile and a legend, counts per tile, and which sources and atlas coordinates the TileSet has. op set: cells [{x, y, source, atlas: [x, y], alternative?}]. op fill: a rect with one tile. op erase: cells or a rect. op clear: every cell. A source or atlas coordinate the TileSet does not have is refused. Dry run by default; write: true writes, and godot_undo takes it back.
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": {
"scene": "<scene>",
"op": "<op>"
},
"name": "godot_tilemap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | what to do | |
| node | No | path of the TileMapLayer in the scene (default: the only one) | |
| rect | No | fill or erase: the area | |
| atlas | No | fill: atlas coordinates of the tile | |
| cells | No | set: cells with source and atlas; erase: cells with x and y | |
| limit | No | read: cells to list | |
| scene | Yes | the .tscn file (res:// path, or relative to the project) | |
| write | No | write the change (default false: show it) | |
| source | No | fill: the TileSet source id | |
| alternative | No | fill: alternative tile id (default 0) |