tiled-mcp
v1.0.3Inspect, validate and surgically edit Tiled map files (.tmx/.tmj) — byte-preserving, 12 tools.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
map_info Map key figures
Key figures of a Tiled map: size, orientation, layers, tilesets, object counts, map properties. Whatever is not in the file is reported as n/a.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to ONE Tiled map file (.tmx or .tmj) — no directory, no wildcards. Please pass it absolute: a relative path is resolved against the working directory of the server process, and that is chosen b… |
list_layers List layers
All layers of the map in render order, recursively through group layers, with id, kind, size, encoding and visibility.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to ONE Tiled map file (.tmx or .tmj) — no directory, no wildcards. Please pass it absolute: a relative path is resolved against the working directory of the server process, and that is chosen b… |
read_layer Read layer contents
Reads the tiles of a tile layer, optionally only a sub-rectangle. Outputs raw GID values including flip bits (0 = empty cell). If the output is truncated, that is stated visibly.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to ONE Tiled map file (.tmx or .tmj) — no directory, no wildcards. Please pass it absolute: a relative path is resolved against the working directory of the server process, and that is chosen b… |
height | integer | Height of the region. Default: to the bottom edge. |
layer | string | Name of the layer; inside groups also 'group/layer'. Alternatively use layer_id. |
layer_id | integer | Id of the layer. Unique, unlike the name. Alternatively use layer. |
max_cells | integer | Upper limit of cells in the output. Default 2048. |
width | integer | Width of the region. Default: to the right edge. |
with_flags | boolean | true shows 'index[HVD]' instead of the raw value. Default: false. |
x | integer | Left edge of the region in tiles. Default 0. |
y | integer | Top edge of the region in tiles. Default 0. |
tile_stats Tile usage
Usage histogram: which tile index occurs how often, which tiles of a tileset are unused, how many cells are empty and which flip-bit combinations occur.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to ONE Tiled map file (.tmx or .tmj) — no directory, no wildcards. Please pass it absolute: a relative path is resolved against the working directory of the server process, and that is chosen b… |
layer | string | Name of the layer; inside groups also 'group/layer'. Alternatively use layer_id. |
layer_id | integer | Id of the layer. Unique, unlike the name. Alternatively use layer. |
max_entries | integer | Upper limit per list. Default 100. Truncation is reported. |
find_tiles Find tiles
Finds every occurrence of a tile and returns its coordinates. Either via gid (flip bits are masked out) or via a tile property from the tileset.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to ONE Tiled map file (.tmx or .tmj) — no directory, no wildcards. Please pass it absolute: a relative path is resolved against the working directory of the server process, and that is chosen b… |
gid | integer | GID to look for. Compared on the tile index without flip bits. |
layer | string | Name of the layer; inside groups also 'group/layer'. Alternatively use layer_id. |
layer_id | integer | Id of the layer. Unique, unlike the name. Alternatively use layer. |
limit | integer | Upper limit of hits shown. Default 200. |
property | string | Alternatively: name of a tile property from the tileset. |
value | string | Optional value for property, compared as text. |
replace_tiles Replace tiles
Replaces tile A with tile B, optionally only in one layer and/or one rectangle. Comparison and writing happen on the tile index; the flip bits of every cell are kept. Writes the file only if there really is something to change.
| Parameter | Type | Description |
|---|---|---|
from_gid * | integer | GID to replace. Compared on the tile index. |
path * | string | Path to ONE Tiled map file (.tmx or .tmj) — no directory, no wildcards. Please pass it absolute: a relative path is resolved against the working directory of the server process, and that is chosen b… |
to_gid * | integer | New GID. 0 clears the cell. |
dry_run | boolean | true = compute and report everything, but write nothing. Default: false. |
height | integer | Height of the rectangle. Default: to the bottom edge. |
keep_flags | boolean | true (default): every cell keeps its flip bits. false: the flip bits from to_gid apply. |
layer | string | Name of the layer; inside groups also 'group/layer'. Alternatively use layer_id. |
layer_id | integer | Id of the layer. Unique, unlike the name. Alternatively use layer. |
width | integer | Width of the rectangle. Default: to the right edge. |
x | integer | Left edge of the rectangle. Default 0. |
y | integer | Top edge of the rectangle. Default 0. |
fill_region Fill a rectangle
Fills a rectangle of a tile layer with one tile. gid=0 clears the cells. A rectangle outside the layer is rejected, not clipped.
| Parameter | Type | Description |
|---|---|---|
gid * | integer | GID of the fill tile, flip bits allowed. 0 clears the cells. |
height * | integer | Height of the rectangle in tiles. |
path * | string | Path to ONE Tiled map file (.tmx or .tmj) — no directory, no wildcards. Please pass it absolute: a relative path is resolved against the working directory of the server process, and that is chosen b… |
width * | integer | Width of the rectangle in tiles. |
x * | integer | Left edge of the rectangle in tiles. |
y * | integer | Top edge of the rectangle in tiles. |
dry_run | boolean | true = compute and report everything, but write nothing. Default: false. |
layer | string | Name of the layer; inside groups also 'group/layer'. Alternatively use layer_id. |
layer_id | integer | Id of the layer. Unique, unlike the name. Alternatively use layer. |
validate_map Validate a map
Checks the map: missing tileset, image and file-property files, GIDs outside the tilesets, duplicate layer and object ids, nextlayerid/nextobjectid that are too small, object properties pointing nowhere. Every finding has its own code and its own message. The answer always names both: which classes were checked and which are NOT checked in v1. If the map cannot be loaded at all, that is stated as a finding and all content checks are n/a.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to ONE Tiled map file (.tmx or .tmj) — no directory, no wildcards. Please pass it absolute: a relative path is resolved against the working directory of the server process, and that is chosen b… |
objects_list List objects
Lists the objects of the object layers with id, name, type, shape, position, size, rotation, gid and properties. Optionally filtered by layer, id, name or type.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to ONE Tiled map file (.tmx or .tmj) — no directory, no wildcards. Please pass it absolute: a relative path is resolved against the working directory of the server process, and that is chosen b… |
id | integer | Only the object with this id. |
layer | string | Name of the layer; inside groups also 'group/layer'. Alternatively use layer_id. |
layer_id | integer | Id of the layer. Unique, unlike the name. Alternatively use layer. |
limit | integer | Upper limit of objects shown. Default 200. |
name | string | Only objects with this name. |
type | string | Only objects with this class (attribute type). |
object_upsert Create or change an object
Without id: creates a new object (rectangle, or a tile object when gid is given); the id comes from nextobjectid, which is raised afterwards. With id: changes exactly the fields that were passed. Shape changes and template instances are not editable in v1 and are rejected.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to ONE Tiled map file (.tmx or .tmj) — no directory, no wildcards. Please pass it absolute: a relative path is resolved against the working directory of the server process, and that is chosen b… |
dry_run | boolean | true = compute and report everything, but write nothing. Default: false. |
gid | integer | GID for a tile object, flip bits allowed. |
height | number | Height in pixels. |
id | integer | Id of an existing object. Without id a new one is created. |
layer | string | Name of the layer; inside groups also 'group/layer'. Alternatively use layer_id. |
layer_id | integer | Id of the layer. Unique, unlike the name. Alternatively use layer. |
name | string | Name of the object. |
rotation | number | Rotation in degrees, clockwise. |
type | string | Class of the object (attribute type). |
visible | boolean | Visibility of the object. |
width | number | Width in pixels. |
x | number | X position in pixels. Required when creating. |
y | number | Y position in pixels. Required when creating. |
object_delete Delete an object
Deletes an object by its id. nextobjectid stays unchanged, because Tiled never reuses deleted ids.
| Parameter | Type | Description |
|---|---|---|
id * | integer | Id of the object to delete. |
path * | string | Path to ONE Tiled map file (.tmx or .tmj) — no directory, no wildcards. Please pass it absolute: a relative path is resolved against the working directory of the server process, and that is chosen b… |
dry_run | boolean | true = compute and report everything, but write nothing. Default: false. |
layer | string | Name of the layer; inside groups also 'group/layer'. Alternatively use layer_id. |
layer_id | integer | Id of the layer. Unique, unlike the name. Alternatively use layer. |
map_summary Map summary
Markdown summary of a map for chat context: key figures, layers, tilesets, properties, objects and the warnings from loading.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to ONE Tiled map file (.tmx or .tmj) — no directory, no wildcards. Please pass it absolute: a relative path is resolved against the working directory of the server process, and that is chosen b… |