Skip to main content
Glama

Read and edit TileMapLayer cells

godot_tilemap
Idempotent

Read 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

NameRequiredDescriptionDefault
opYeswhat to do
nodeNopath of the TileMapLayer in the scene (default: the only one)
rectNofill or erase: the area
atlasNofill: atlas coordinates of the tile
cellsNoset: cells with source and atlas; erase: cells with x and y
limitNoread: cells to list
sceneYesthe .tscn file (res:// path, or relative to the project)
writeNowrite the change (default false: show it)
sourceNofill: the TileSet source id
alternativeNofill: alternative tile id (default 0)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.0

TDQS

A4.4/5.0
Behavior5/5

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

Adds materially beyond the annotations: dry-run-by-default with write:true as the commit switch, reversibility via godot_undo, validation refusal for unknown source/atlas, and the exact contents of the read result (used area map, legend, per-tile counts, TileSet coords). That is precisely the safety and side-effect context an agent needs before mutating scene data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads what the tool operates on, then enumerates ops in a compact parallel structure; nearly every clause carries operational meaning. It is dense and slightly run-on, but no sentence is filler.

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

Completeness3/5

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

With 10 parameters, nested cell objects and no output schema, the description does a good job documenting the read return shape and the write safety model, but leaves the set/fill/erase/clear response and the limit/node semantics unaddressed. Adequate rather than complete for a tool of this complexity.

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 the baseline is 3, but the description goes further by mapping parameters to operations: cells[{x,y,source,atlas,alternative?}] for set, rect/source/atlas/alternative for fill, x/y-only cells for erase. It omits the limit and node parameters, leaving those 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 concrete verb+resource: read and write TileMapLayer cell data inside a .tscn scene file, with version gate (Godot 4.3+) and the key differentiator that the cells are packed bytes a text editor cannot touch. An agent can tell immediately this is not the generic scene-edit tool.

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 explicit per-op routing: read for inspection, set for explicit cell lists, fill for a rect with one tile, erase for cells/rect, clear for everything, plus the prerequisite that sources/atlas coords must exist in the TileSet or the call is refused, and points to godot_undo for reversal. It stops short of an explicit 'use godot_scene_edit instead when...' comparison, so not a 5.

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