Skip to main content
Glama

tilemap_manage

Edit TileMapLayer tiles in the current Godot scene: set, fill rectangles, clear, read, rotate, flip, or erase cells with undoable operations.

Instructions

TileMap / TileMapLayer authoring (set tiles, fill rects, clear, read cells).

All operations target TileMapLayer nodes in the currently edited scene by scene-relative path (e.g. "/LavaLake20x20/Ground"). All write ops are undoable via EditorUndoRedoManager.

source_id is the TileSet source index. atlas_col/atlas_row are the atlas coordinates of the tile within that source. For full-tile animated sources (lava, water, sewage) use atlas_col=0, atlas_row=0.

IMPORTANT — Source-ID remapping in specialized .tres files: When a layer uses a specialized .tres (e.g. volcano_animated.tres), Source-IDs are re-numbered from 0. Example: volcano lava is Source 8 in the main volcano.tres but Source 0 in volcano_animated.tres. Always use the remapped ID when the TileMapLayer references a specialized .tres, not the original ID from the main .tres.

Ops: • tilemap_set_cell(path, source_id, atlas_col, atlas_row, map_x, map_y) Set a single tile at (map_x, map_y). Returns: {map_x, map_y, source_id, atlas_col, atlas_row}

• tilemap_set_cells_rect(path, source_id, atlas_col, atlas_row, rect_x, rect_y, rect_w, rect_h) Fill a rect_w × rect_h region starting at (rect_x, rect_y) with one tile type in a single undo action. Returns: {cells_filled, rect: {x, y, w, h}}

• tilemap_clear(path) Remove all tiles from the layer. Returns: {cleared: true}

• tilemap_get_cells(path) Return all used cell coordinates. Returns: {cells: [{x, y}, ...], count: int}

• tilemap_place_tile(path, source_id, atlas_col, atlas_row, map_x, map_y, rotation_degrees=0, flip_h=false, flip_v=false, alternative_tile=-1) Place a tile with rotation and flip flags. Returns: {map_x, map_y, source_id, atlas_col, atlas_row, alternative_tile, rotation_degrees, flip_h, flip_v}

• tilemap_rotate_cell(path, map_x, map_y, degrees=90) Rotate an existing tile cell at (map_x, map_y) clockwise by degrees (90, 180, 270). Returns: {map_x, map_y, degrees, old_alternative, new_alternative}

• tilemap_flip_cell(path, map_x, map_y, flip_h=false, flip_v=false) Flip an existing tile cell at (map_x, map_y) horizontally and/or vertically. Returns: {map_x, map_y, flip_h_applied, flip_v_applied, new_alternative}

• tilemap_erase_cell(path, map_x, map_y) Erase a single tile cell at (map_x, map_y). Returns: {map_x, map_y, erased}

• tilemap_get_cell(path, map_x, map_y) Get detailed information of a tile cell. Returns: {has_tile, map_x, map_y, source_id, atlas_col, atlas_row, alternative_tile, flip_h, flip_v, transpose}

Canonical call shape: {"op": "<verb>", "params": {...}}. Flat op parameters are accepted as a compatibility alias when the client transmits them; op and session_id remain top-level.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opYes
paramsNo
session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.1.0

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses that all write ops are undoable via EditorUndoRedoManager, explains the source-ID remapping nuance, and lists return values for every operation. It does not mention failure modes or permissions, but covers the essential behavioral traits. It does not contradict any annotations.

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

Conciseness3/5

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

The description is lengthy but well-structured, using a bulleted list of operations with parameter signatures and return values. It front-loads the purpose and critical remapping warning. Some redundancy exists (e.g., repeating parameter meanings across ops), but the complexity of multiple ops justifies the length. It is not overly verbose.

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 the tool's complexity (9 operations, various parameters, special source-ID handling), the description is exceptionally complete. It covers all operations, their parameters, return values, the canonical call shape, and the critical remapping rule. An agent can invoke any operation correctly without external context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% – the schema only defines op, params, and session_id. The description compensates fully by documenting every operation's parameters (e.g., source_id, atlas_col/row, map_x/map_y, rotation, flips), the canonical call shape, and the compatibility alias. It adds substantial meaning beyond the raw 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?

The description clearly states the tool's purpose: 'TileMap / TileMapLayer authoring' with a list of specific operations (set tiles, fill rects, clear, read cells). It specifies the resource type and the domain (tilemap editing), distinguishing it from siblings like tileset_manage or gridmap_manage. The verb+resource pattern is explicit and unambiguous.

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?

The description provides clear context on when to use this tool: it targets TileMapLayer nodes in the currently edited scene with scene-relative paths, and explains the source-ID remapping for specialized .tres files. It does not explicitly state alternatives or when not to use it, but the context is sufficiently clear for an agent to select it appropriately among siblings.

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