# Tool reference The server exposes **35 tools** and **1 prompt**. Every tool returns a JSON document as text. Invalid input or an impossible action (unknown `mapId`, a cell outside the grid, a chest on a wall) comes back as a tool error whose message says how to fix the call. Coordinates are grid cells: `x` is the column (0..width-1) and `y` the row (0..height-1). On an isometric map, cell (0,0) is the top corner of the diamond; `x` grows toward the lower right and `y` toward the lower left. See [map-format.md](map-format.md) for the layers and properties. Tags: `read-only` never changes anything, `destructive` can delete or overwrite, `idempotent` is safe to repeat, `network` calls an external service. ## Contents - **Map lifecycle**: [`list_themes`](#list_themes), [`create_map`](#create_map), [`list_maps`](#list_maps), [`describe_map`](#describe_map), [`discard_map`](#discard_map) - **Painting tiles**: [`paint_tile`](#paint_tile), [`paint_rect`](#paint_rect), [`paint_wall_border`](#paint_wall_border), [`erase_tile`](#erase_tile), [`get_tile_info`](#get_tile_info) - **Rooms and corridors**: [`generate_room`](#generate_room), [`generate_corridor`](#generate_corridor) - **Layout presets**: [`generate_crypt_layout`](#generate_crypt_layout), [`generate_castle_floor`](#generate_castle_floor), [`generate_werewolf_den`](#generate_werewolf_den) - **Objects**: [`place_door`](#place_door), [`place_chest`](#place_chest), [`place_stairs_object`](#place_stairs_object), [`place_trap`](#place_trap), [`place_lever`](#place_lever) - **Spawns**: [`place_spawn_player`](#place_spawn_player), [`place_spawn_enemy`](#place_spawn_enemy), [`place_spawn_npc`](#place_spawn_npc) - **Validation and export**: [`validate_map`](#validate_map), [`export_json`](#export_json), [`save_to_disk`](#save_to_disk) - **Sprites (optional, generation is paid)**: [`preview_sprite_prompt`](#preview_sprite_prompt), [`generate_tile_sprite`](#generate_tile_sprite), [`generate_theme_sprite_set`](#generate_theme_sprite_set), [`override_tile_image`](#override_tile_image) - **Other**: [`generate_building_sprite`](#generate_building_sprite), [`place_building`](#place_building), [`link_maps`](#link_maps), [`validate_world`](#validate_world), [`save_world`](#save_world) - **Prompt**: [`map_builder`](#prompt-map_builder) ## Map lifecycle ### list_themes `read-only` Lists the available map themes (tile palettes): key, display name, description, the tile roles each theme provides, and whether its sprite PNGs are present locally (sprites.status: all, partial or none). Themes without sprites still produce valid maps; Tiled shows placeholders until the sprites exist. No parameters. ### create_map `writes map` Creates an empty isometric (default) or orthogonal Tiled map in the given theme and returns its mapId, which every other tool needs. Sides go up to 256 cells, so one map can hold a whole village or region with buildings (place_building). The map has three tile layers (ground, walls, decorations) and two object layers (objects, spawns). Maps live in server memory until saved with save_to_disk or save_world, or exported with export_json; they are lost when the server restarts. | Parameter | Type | Required | Notes | |---|---|---|---| | `name` | string | yes | Display name of the map, e.g. 'Crypt under the abandoned chapel'. 1..120 chars | | `width` | integer | yes | Width in cells, 4..256 (1 cell = 5 ft in tabletop terms). 4..256 | | `height` | integer | yes | Height in cells, 4..256. 4..256 | | `theme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIER`, `FLOODED`, `VOLCANO`, `DARK_FOREST`, `WINTER`, `SPRING`, `SUMMER`, `AUTUMN`, `DESOLATION`, `FUTURISTIC`, `ELECTRONIC` | yes | Theme key from list_themes, e.g. CRYPT | | `orientation` | `isometric`, `orthogonal` | no | Defaults to isometric | ### list_maps `read-only` Lists the maps held in memory by this server session, with their summaries. No parameters. ### describe_map `read-only` Returns a summary of one map: size, orientation, theme, tile counts per tile type, and number of objects and spawns. | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | mapId returned by create_map | ### discard_map `destructive` `idempotent` Deletes a map from server memory. Irreversible unless it was saved or exported first. | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | mapId returned by create_map | ## Painting tiles ### paint_tile `idempotent` Paints a single cell of a tile layer with a tile role. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `layer` | `ground`, `walls`, `decorations` | yes | ground = floors, hazards and difficult terrain; walls = wall tiles drawn above the ground (a cell with a wall is impassable); decorations = props above the ground (obstacle_decor blocks movement, decoration_minor is walkable) | | `x` | integer | yes | 0..9007199254740991 | | `y` | integer | yes | 0..9007199254740991 | | `role` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | yes | Tile role, resolved to a sprite by the map's theme | ### paint_rect `idempotent` Paints every cell of the rectangle between two opposite corners (inclusive) on one layer. Typical use: paint_rect on 'ground' with walkable_floor for a room's floor. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `layer` | `ground`, `walls`, `decorations` | yes | ground = floors, hazards and difficult terrain; walls = wall tiles drawn above the ground (a cell with a wall is impassable); decorations = props above the ground (obstacle_decor blocks movement, decoration_minor is walkable) | | `x1` | integer | yes | 0..9007199254740991 | | `y1` | integer | yes | 0..9007199254740991 | | `x2` | integer | yes | 0..9007199254740991 | | `y2` | integer | yes | 0..9007199254740991 | | `role` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | yes | Tile role, resolved to a sprite by the map's theme | ### paint_wall_border `idempotent` Paints walls on the outline of a rectangle (inclusive corners) on the 'walls' layer, to enclose a room quickly. Erase single wall cells afterwards (erase_tile layer=walls) to open doorways. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `x1` | integer | yes | 0..9007199254740991 | | `y1` | integer | yes | 0..9007199254740991 | | `x2` | integer | yes | 0..9007199254740991 | | `y2` | integer | yes | 0..9007199254740991 | ### erase_tile `destructive` `idempotent` Clears one cell of a tile layer (for example to open a doorway in a wall). Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `layer` | `ground`, `walls`, `decorations` | yes | ground = floors, hazards and difficult terrain; walls = wall tiles drawn above the ground (a cell with a wall is impassable); decorations = props above the ground (obstacle_decor blocks movement, decoration_minor is walkable) | | `x` | integer | yes | 0..9007199254740991 | | `y` | integer | yes | 0..9007199254740991 | ### get_tile_info `read-only` Returns the tile on one layer at (x, y): gid (0 = empty), role, tile type and sprite id, plus the object or spawn standing on that cell if any. Check layer=walls before placing objects: a wall sits on top of a walkable ground tile. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `layer` | `ground`, `walls`, `decorations` | yes | ground = floors, hazards and difficult terrain; walls = wall tiles drawn above the ground (a cell with a wall is impassable); decorations = props above the ground (obstacle_decor blocks movement, decoration_minor is walkable) | | `x` | integer | yes | 0..9007199254740991 | | `y` | integer | yes | 0..9007199254740991 | ## Rooms and corridors ### generate_room `writes map` Builds a rectangular room in one call: walkable floor, a wall border, and a doorway with a closed door for each exit. Options add a hazard tile in the centre and obstacle props in the four inner corners (only if the theme defines those roles). originX/originY is the room's top-left cell; the walls are part of the room's width and height. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `originX` | integer | yes | 0..9007199254740991 | | `originY` | integer | yes | 0..9007199254740991 | | `width` | integer | yes | Outer width including walls. 3..40 | | `height` | integer | yes | Outer height including walls. 3..40 | | `exits` | array of { direction: `north`, `south`, `east`, `west`; offset: integer } | no | max 4 items | | `hazardCenter` | boolean | no | Paint the theme's hazard_primary tile at the room centre | | `obstacleCorners` | boolean | no | Paint obstacle_decor props in the four inner corners | ### generate_corridor `writes map` Draws a straight, axis-aligned corridor between (fromX,fromY) and (toX,toY): walkable floor plus side walls. Interior width defaults to 1 (3 cells including both walls). Side walls that cross an existing room are painted too, so connect corridors to doorways. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `fromX` | integer | yes | 0..9007199254740991 | | `fromY` | integer | yes | 0..9007199254740991 | | `toX` | integer | yes | 0..9007199254740991 | | `toY` | integer | yes | 0..9007199254740991 | | `width` | integer | no | Interior width in cells (default 1). 1..4 | ## Layout presets ### generate_crypt_layout `writes map` Fills a map with a crypt: entrance hall (west), central nave, north and south burial chambers, and a deep crypt (east) with a hazard tile and corner obstacles, all connected by doors and corridors. Needs a map of at least 27x18. Suited to the CRYPT, BLOOD_TOMB and MAUSOLEUM themes. Adds a player spawn in the entrance unless addPlayerSpawn is false. | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `addPlayerSpawn` | boolean | no | Place a player spawn in the entrance (default true) | ### generate_castle_floor `writes map` Fills a map with a castle floor: antechamber (west) behind a locked main door (pick DC 18), a great hall, north and south wings, and a far room (east) whose content depends on floorVariant. The 'throne' variant adds a throne prop and an enemy 'Castle lord' spawn. Needs a map of at least 27x20. Suited to the CASTLE theme. | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `floorVariant` | `entrance`, `throne`, `private_chambers` | no | entrance = inner courtyard, throne = throne room (default), private_chambers = private apartments | | `addPlayerSpawn` | boolean | no | Place a player spawn in the antechamber (default true) | ### generate_werewolf_den `writes map` Fills a map with a cave den: cave mouth (west), hunting hall with bone obstacles, a nest of young wolves (north), a bone store (south) and the alpha's lair (east) with a hazard tile. Adds enemy spawns 'Alpha werewolf' and 'Werewolf cub'. Needs a map of at least 22x16. Suited to the WEREWOLF_DEN theme. | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `addPlayerSpawn` | boolean | no | Place a player spawn at the cave mouth (default true) | ## Objects ### place_door `writes map` Adds a door to the 'objects' layer. Put doors in a wall opening: erase the wall at that cell first (erase_tile layer=walls) and keep a ground tile under it; generate_room does this for its exits. A locked door needs pickDC to be picked open. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `x` | integer | yes | 0..9007199254740991 | | `y` | integer | yes | 0..9007199254740991 | | `locked` | boolean | no | Defaults to false (closed but unlocked) | | `pickDC` | integer | no | Difficulty class to pick the lock (5..30). 5..30 | | `targetZoneId` | string | no | Optional id of the zone this door leads to (for multi-zone dungeons) | | `name` | string | no | | ### place_chest `writes map` Adds a chest to the 'objects' layer. A locked chest needs pickDC to be opened. The cell must be painted ground without a wall and without another object or spawn; otherwise the call fails with an explanation. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `x` | integer | yes | 0..9007199254740991 | | `y` | integer | yes | 0..9007199254740991 | | `locked` | boolean | no | | | `pickDC` | integer | no | Difficulty class to pick the lock (5..30). 5..30 | | `name` | string | no | | ### place_stairs_object `writes map` Adds a stairs object that moves the party to another zone (targetZoneId). Unlike the decorative 'stairs' tile role, this object carries the zone link. The cell must be painted ground without a wall and without another object or spawn; otherwise the call fails with an explanation. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `x` | integer | yes | 0..9007199254740991 | | `y` | integer | yes | 0..9007199254740991 | | `targetZoneId` | string | yes | Id of the destination zone | | `name` | string | no | | ### place_trap `writes map` Adds a trap to the 'objects' layer. Entering the cell triggers a saving throw when trapSaveDC is set, otherwise the damage applies automatically. The cell must be painted ground without a wall and without another object or spawn; otherwise the call fails with an explanation. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `x` | integer | yes | 0..9007199254740991 | | `y` | integer | yes | 0..9007199254740991 | | `trapType` | string | yes | Damage type, e.g. piercing, fire, poison, lightning | | `trapNotation` | string | yes | Damage dice, e.g. 2d6 or 3d4+1. pattern `^\d+[dD]\d+([+-]\d+)?$` | | `trapSaveDC` | integer | no | Saving throw difficulty class (5..30). 5..30 | | `name` | string | no | | ### place_lever `writes map` Adds a lever players can pull. Its effect is up to the game engine that loads the map. The cell must be painted ground without a wall and without another object or spawn; otherwise the call fails with an explanation. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `x` | integer | yes | 0..9007199254740991 | | `y` | integer | yes | 0..9007199254740991 | | `name` | string | no | | ## Spawns ### place_spawn_player `writes map` Adds a player start point to the 'spawns' layer. Every playable map needs at least one (validate_map warns otherwise). The cell must be painted ground without a wall and without another object or spawn; otherwise the call fails with an explanation. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `x` | integer | yes | 0..9007199254740991 | | `y` | integer | yes | 0..9007199254740991 | | `name` | string | no | | ### place_spawn_enemy `writes map` Adds an enemy spawn point to the 'spawns' layer. encounterId links it to an encounter defined by the game engine; npcName is the creature's display name. The cell must be painted ground without a wall and without another object or spawn; otherwise the call fails with an explanation. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `x` | integer | yes | 0..9007199254740991 | | `y` | integer | yes | 0..9007199254740991 | | `encounterId` | string | no | Id of an existing encounter in the game engine | | `npcName` | string | no | Display name, e.g. 'Alpha werewolf' | | `name` | string | no | | ### place_spawn_npc `writes map` Adds a non-hostile NPC spawn point (merchant, quest giver, ally) to the 'spawns' layer. The cell must be painted ground without a wall and without another object or spawn; otherwise the call fails with an explanation. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `x` | integer | yes | 0..9007199254740991 | | `y` | integer | yes | 0..9007199254740991 | | `npcName` | string | no | Display name, e.g. 'Old innkeeper' | | `name` | string | no | | ## Validation and export ### validate_map `read-only` Checks the map before export: Tiled structure (errors) and gameplay sanity (warnings): at least one player spawn, no object or spawn on a wall or outside the painted ground, no spawn inside an obstacle prop, no door left inside a wall, and walking reachability: every object and floor area can be reached on foot from where the player starts or arrives (walls, obstacle props, unpainted cells and buildings block; objects and spawns do not; no diagonal moves; a map transition must be stepped on, anything else can be used from a side cell), following map links like validate_world. Returns { ok, errors, warnings }. | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | ### export_json `read-only` Returns the full Tiled JSON (.tmj content) of a map as text, each tile layer's data on one line. Sprite paths are written as './assets//.png' relative to the repository root; use save_to_disk to get a file whose sprite paths resolve from where it is saved. Large maps make long answers: prefer save_to_disk or save_world above 64x64. | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | ### save_to_disk `destructive` `idempotent` Writes the map to a .tmj file that opens directly in the Tiled editor. A relative path is resolved against the maps folder (the repository's maps/ by default, or TILED_MAPS_DIR); an absolute path is used as is. Missing folders are created and an existing file is overwritten. Sprite paths inside the file are rewritten relative to its location so Tiled finds the PNGs. For maps linked by place_building or link_maps, use save_world so the linked files land side by side under the names their links use. | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `path` | string | yes | File path ending in .tmj or .json, e.g. 'crypt-chapel.tmj' (goes to the maps folder) or an absolute path. min 1 chars | ## Sprites (optional, generation is paid) ### preview_sprite_prompt `read-only` Free: returns the exact FLUX prompt, geometry and size generate_tile_sprite would use for (theme, role) with optional overrides, without calling any service. Use it to iterate on wording before paying for a generation. | Parameter | Type | Required | Notes | |---|---|---|---| | `theme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIER`, `FLOODED`, `VOLCANO`, `DARK_FOREST`, `WINTER`, `SPRING`, `SUMMER`, `AUTUMN`, `DESOLATION`, `FUTURISTIC`, `ELECTRONIC` | yes | Theme key from list_themes | | `role` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | yes | Tile role, e.g. walkable_floor, wall, obstacle_decor | | `material` | string | no | | | `lighting` | string | no | | | `extraDetail` | string | no | | ### generate_tile_sprite `network` PAID: generates one isometric sprite for (theme, role) with FLUX.1-dev via Hugging Face Inference Providers, removes the magenta background and resizes it to 64x32 (floors) or 64x64 (walls, props). Saves //.png, or __.png when variant is set. Takes 20-40 s and costs money per call; check that the file is missing first (list_themes shows missing sprites) and preview the prompt with preview_sprite_prompt. An existing file is kept unless force is true. | Parameter | Type | Required | Notes | |---|---|---|---| | `theme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIER`, `FLOODED`, `VOLCANO`, `DARK_FOREST`, `WINTER`, `SPRING`, `SUMMER`, `AUTUMN`, `DESOLATION`, `FUTURISTIC`, `ELECTRONIC` | yes | Theme key from list_themes | | `role` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | yes | Tile role, e.g. walkable_floor, wall, obstacle_decor | | `variant` | string | no | Contextual variant slug, e.g. 'alembic' for a laboratory: saved as __.png and bound to a map with override_tile_image. pattern `^[a-z0-9_]+$` | | `material` | string | no | Override of the material description, e.g. 'alchemical workbench with brass alembics' | | `lighting` | string | no | Override of the lighting description | | `extraDetail` | string | no | Free text appended to the prompt | | `seed` | integer | no | Seed for reproducibility. -9007199254740991..9007199254740991 | | `force` | boolean | no | Regenerate even if the file already exists (paid again) | | `outputDir` | string | no | Output folder; relative paths resolve against the assets folder. Defaults to // | ### generate_theme_sprite_set `network` PAID and slow: generates every sprite of a theme that is missing on disk (about 30 s and one paid call per sprite, typically 8-10 sprites, so 4-5 minutes). Existing sprites are skipped unless force is true. Many MCP clients time out on calls this long; for a whole theme prefer the command line script: node scripts/gen-theme-set.mjs --yes. | Parameter | Type | Required | Notes | |---|---|---|---| | `theme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIER`, `FLOODED`, `VOLCANO`, `DARK_FOREST`, `WINTER`, `SPRING`, `SUMMER`, `AUTUMN`, `DESOLATION`, `FUTURISTIC`, `ELECTRONIC` | yes | Theme key from list_themes | | `force` | boolean | no | Regenerate sprites that already exist (paid again) | | `seed` | integer | no | -9007199254740991..9007199254740991 | ### override_tile_image `idempotent` Points one role of a single map's tileset at a variant image, e.g. obstacle_decor__alembic.png instead of obstacle_decor.png. Only that map changes; other maps and the theme keep their defaults. Call after create_map and before saving or exporting. | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | | | `role` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | yes | Tile role, e.g. walkable_floor, wall, obstacle_decor | | `variant` | string | yes | Variant slug: the file //__.png should exist. pattern `^[a-z0-9_]+$` | | `imageWidth` | integer | no | Image width in pixels if it differs from the default. -9007199254740991..9007199254740991 | | `imageHeight` | integer | no | Image height in pixels if it differs from the default. -9007199254740991..9007199254740991 | | `customPath` | string | no | Use this image path verbatim instead of the './assets//__.png' convention | ## Other ### generate_building_sprite `network` PAID unless dryRun is true: generates the sprite place_building draws for a building type (house, shop, tavern, temple, tower, castle) with FLUX.1-dev via Hugging Face Inference Providers, removes the magenta background and fits the building into its footprint size (house and shop 192x192, tavern and temple 256x256, tower 128x192, castle 384x384). Saves /buildings/.png, or __.png when variant is set. Takes 20-40 s and costs money per call; dryRun returns the prompt for free. An existing sprite is kept unless force is true. | Parameter | Type | Required | Notes | |---|---|---|---| | `buildingType` | `house`, `shop`, `tavern`, `temple`, `tower`, `castle` | yes | Building type, as in place_building | | `variant` | string | no | Variant slug, e.g. 'snowy': saved as __.png and used with place_building spriteVariant. pattern `^[a-z0-9_]+$` | | `material` | string | no | Override of the building description | | `lighting` | string | no | Override of the lighting description | | `extraDetail` | string | no | Free text appended to the prompt | | `seed` | integer | no | Seed for reproducibility. -9007199254740991..9007199254740991 | | `force` | boolean | no | Regenerate even if the sprite already exists (paid again) | | `dryRun` | boolean | no | Return the prompt and target size without generating anything (free) | ### place_building `writes map` Puts a building on an outdoor map and, by default, creates its interior as a new map linked both ways. Footprints are square: house 3x3, shop 3x3, tavern 4x4, temple 4x4, tower 2x2, castle 6x6 cells, starting at (x, y), the footprint's top corner; every footprint cell needs painted ground, no wall and no object (props on the decorations layer are cleared). The building is drawn by a large sprite (assets/buildings/.png, made with generate_building_sprite) on a 'buildings' layer; until it exists Tiled and the preview show a placeholder. With an interior, the call adds an 'entrance' on the door cell of the footprint edge (door=south, the default, or east), an 'arrival' spawn on the free cell in front of it, and in the interior map an 'exit' in the wall and an 'arrival' spawn just inside. Interiors default to a furnished single room (house, shop, tavern, temple, tower) or a full castle floor (castle, needs 27x20); edit them afterwards with the usual tools using the returned interior mapId. A transition is an object with targetMap (a 'file' property: the .tmj file of the other map) and targetSpawn (the name of an 'arrival' spawn in that map). In the game, stepping on it loads targetMap and puts the player on targetSpawn. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | The outdoor map | | `buildingType` | `house`, `shop`, `tavern`, `temple`, `tower`, `castle` | yes | | | `x` | integer | yes | Column of the footprint's top corner. 0..9007199254740991 | | `y` | integer | yes | Row of the footprint's top corner. 0..9007199254740991 | | `name` | string | no | Display name, e.g. 'Miller house'; also the base of the building id. 1..80 chars | | `door` | `south`, `east` | no | Footprint edge with the door: south (default, bottom-left face) or east (bottom-right face) | | `interior` | boolean | no | Create and link an interior map (default true); false places a building that cannot be entered | | `interiorTheme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIER`, `FLOODED`, `VOLCANO`, `DARK_FOREST`, `WINTER`, `SPRING`, `SUMMER`, `AUTUMN`, `DESOLATION`, `FUTURISTIC`, `ELECTRONIC` | no | Theme of the interior (default per type: TAVERN_BLOOD_PRINCE, MAUSOLEUM or CASTLE) | | `interiorWidth` | integer | no | Interior width in cells (default per type). 5..256 | | `interiorHeight` | integer | no | Interior height in cells (default per type). 5..256 | | `spriteVariant` | string | no | Use assets/buildings/__.png instead of .png. pattern `^[a-z0-9_]+$` | ### link_maps `writes map` Joins two maps both ways with a door or stairs object on each side, for example the floors of a castle or a cave under a house. Each object leads to the other map; an 'arrival' spawn is put on a free floor cell next to each object (or on the arrival cell you pass). A door cell may be in a wall: the wall is opened. A transition is an object with targetMap (a 'file' property: the .tmj file of the other map) and targetSpawn (the name of an 'arrival' spawn in that map). In the game, stepping on it loads targetMap and puts the player on targetSpawn. Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one). | Parameter | Type | Required | Notes | |---|---|---|---| | `fromMapId` | string | yes | | | `fromX` | integer | yes | 0..9007199254740991 | | `fromY` | integer | yes | 0..9007199254740991 | | `toMapId` | string | yes | | | `toX` | integer | yes | 0..9007199254740991 | | `toY` | integer | yes | 0..9007199254740991 | | `kind` | `door`, `stairs` | yes | Object placed on both sides | | `name` | string | no | Base name of the two objects (default '-to-'). 1..80 chars | | `fromArrivalX` | integer | no | 0..9007199254740991 | | `fromArrivalY` | integer | no | 0..9007199254740991 | | `toArrivalX` | integer | no | 0..9007199254740991 | | `toArrivalY` | integer | no | 0..9007199254740991 | ### validate_world `read-only` Checks the maps linked to mapId (or every map of the session): each transition leads to a map of this session and to an arrival spawn that exists there (errors), every link has a way back, every map can be entered, some map has a player spawn, building sprites exist, and the whole world can be walked: starting from the player spawn and following each transition the player can reach on foot, every object and floor area of every map is reachable and no arrival point is walled in (warnings, prefixed with the map's file name). Also lists the maps with their file names and every link. Run validate_map on each map too. | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | no | Any map of the world; omit to check every map of the session | ### save_world `destructive` `idempotent` Writes mapId and every map linked to it (buildings' interiors, linked floors) into one folder, each under the file name its links use (describe_map and validate_world show them), with sprite paths relative to the folder. A relative folder is resolved against the maps folder (the repository's maps/ by default, or TILED_MAPS_DIR); default: a folder named after the map. Existing files are overwritten. | Parameter | Type | Required | Notes | |---|---|---|---| | `mapId` | string | yes | Any map of the world, usually the outdoor map | | `folder` | string | no | Target folder, e.g. 'village-world' or an absolute path. min 1 chars | ## Prompts ### Prompt: map_builder Loads the map-builder skill and applies it to your description of the map: theme, size, encounters, traps, output. | Argument | Required | Notes | |---|---|---| | `description` | yes | Free-form description, e.g. 'crypt 28x18 under a chapel, two skeletons, a locked chest DC 15' |