Skip to main content
Glama

generate_map

Create a new map file (next free map ID, registered in MapInfos.json; both files written immediately). mode selects the generator: "blank" makes an empty map you paint later (edit_map fill_layer); "themed" generates a simple tile layout…

Instructions

Create a new map file (next free map ID, registered in MapInfos.json; both files written immediately). mode selects the generator: "blank" makes an empty map you paint later (edit_map fill_layer); "themed" generates a simple tile layout for a theme using the tileset's real tiles; "procedural" is the full generator — for themes with matching RTP reference templates (town, dungeon, interior, castle, world, etc.) it CLONES a hand-authored template from the 106 bundled maps (real 3D buildings, walls, furniture), auto-picking the closest size; for themes without templates (beach, swamp, etc.) it generates procedurally (Perlin terrain, BSP dungeons, cellular caves). Same seed + params = same map. Every mode except blank and duplicate also returns walkability per map (walkable tiles, main area, cut-off tiles) and warnings when the map is barely walkable or has unreachable pockets. Pass templateId to force a specific template, or useTemplate:false to force procedural. 21 themes incl. snow, volcano, sewer, space_interior; "batch" generates several procedural maps in one call from batch specs; "duplicate" copies an existing map (transfer events still point at their ORIGINAL destinations — review them); "template" instantiates one of the 106 bundled reference maps by templateId (list them with get_project_context detail "templates"); "semantic" is the tileset-independent generator — it lays out a MISSION (entrance, key, locked door, treasure, boss, exit, side rooms) as a graph and only then paints it, asking the tileset profile which tile plays each role, so the layout works on ANY tileset including DLC and third-party packs, and the key is always reachable before the door it opens. It returns markers naming the cell of every mission role, which is where to place events next. Run manage_system action "mine_templates" first so the profile comes from tiles this project actually uses; pass a mined templateId (like "mined-3") to re-materialise one of the project OWN maps onto a different tileset instead of generating a new mission. Returns {mapId, ...} — procedural also returns the seed; batch returns all mapIds keyed for edit_map "connect". Fails with an error on unknown theme/template or unwritable files.

Input Schema

NameRequiredDescriptionDefault
loopNomode "semantic": add one extra corridor so the map has a loop instead of being a tree (default true)
modeNoWhich generator to use; see the tool description. Default "procedural"
nameNoInternal map name for the editor tree (required for mode "duplicate")
noteNoFree-form note field for plugin metadata
seedNoprocedural/batch: random seed for reproducible output (omit for random; returned in the result)
batchNomode "batch" only: one spec per map [{key, name, theme, width, height, tilesetId, seed, parentId}]; key is echoed back to match returned mapIds
roomsNomode "semantic": rooms on the critical path (default 5)
themeNoRequired for themed/procedural. themed: forest, dungeon, town, castle, cave, village, swamp, desert, ruins, interior, beach. procedural adds: snow, harbor, volcano, sewer, fortress, magic_forest, magic_interior, space_interior, space_exterior, world
widthNoMap width in tiles (defaults: blank/themed 17, procedural 30; template uses the template's size)
heightNoMap height in tiles (defaults: blank/themed 13, procedural 25)
lockedNomode "semantic": put a key and a locked door on the path (default true when there are 4+ rooms)
bgmNameNoAudio file from audio/bgm/ to autoplay on entry
parentIdNoMap tree folder to nest the new map under (0 = root)
addEventsNoprocedural: also place themed NPCs/chests/bosses/transfers (default true)
keepPropsNomode "semantic" with a mined templateId: paint the original decorations even onto a different tileset (they may not exist there)
sideRoomsNomode "semantic": dead-end rooms hung off the path, the first holding treasure (default 2)
tilesetIdNoTileset to render with. Defaults to the one matching the theme (Outside=2, Inside=3, Dungeon=4, Overworld=1), so you normally omit it — only set it to override. A mismatched tileset renders the map as garbage
encountersNoprocedural combat themes (dungeon/cave/world/fortress/sewer/volcano): auto-populate the map's random encounters from the project's existing troops so enemies appear while walking. Default true (no-op if the project has no troops yet)
keepEventsNomode "template" only: also copy the template's events (default true)
templateIdNomode "template": bundled template ID. mode "procedural": OPTIONAL — force a specific template ID (from get_project_context detail "templates") instead of auto-picking by theme+size
displayNameNoLocation name briefly shown to the player on entry
sourceMapIdNomode "duplicate" only: existing map ID to copy (unchanged by the operation)
useTemplateNoprocedural: when true (default), clone an RTP template for themes that have one (town, dungeon, interior, etc.) instead of generating procedurally. Set false to force procedural generation even when templates exist
enterableHousesNoprocedural town/village only: also auto-generate an interior map per house with a two-way warp (action-button door outside → interior, walk-on mat inside → back to the street). Default true; the new interior map IDs are returned in interiorMapIds

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv5.19.0
    • addedInput schema / properties / keepProps
      Added value: +{
      +  "description": "mode \"semantic\" with a mined templateId: paint the original decorations even onto a different tileset (they may not exist there)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / locked
      Added value: +{
      +  "description": "mode \"semantic\": put a key and a locked door on the path (default true when there are 4+ rooms)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / loop
      Added value: +{
      +  "description": "mode \"semantic\": add one extra corridor so the map has a loop instead of being a tree (default true)",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / mode / enum
      Previous value: -[
      -  "blank",
      -  "themed",
      -  "procedural",
      -  "batch",
      -  "duplicate",
      -  "template"
      -]New value: +[
      +  "blank",
      +  "themed",
      +  "procedural",
      +  "batch",
      +  "duplicate",
      +  "template",
      +  "semantic"
      +]
    • addedInput schema / properties / rooms
      Added value: +{
      +  "description": "mode \"semantic\": rooms on the critical path (default 5)",
      +  "type": [
      +    "number",
      +    "string"
      +  ]
      +}
    • addedInput schema / properties / sideRooms
      Added value: +{
      +  "description": "mode \"semantic\": dead-end rooms hung off the path, the first holding treasure (default 2)",
      +  "type": [
      +    "number",
      +    "string"
      +  ]
      +}
  2. Changed2 schema fields changedv5.8.1
    • changedInput schema / properties / templateId / description
      Previous value: -"mode \"template\" only: bundled template ID from get_project_context detail \"templates\""New value: +"mode \"template\": bundled template ID. mode \"procedural\": OPTIONAL — force a specific template ID (from get_project_context detail \"templates\") instead of auto-picking by theme+size"
    • addedInput schema / properties / useTemplate
      Added value: +{
      +  "description": "procedural: when true (default), clone an RTP template for themes that have one (town, dungeon, interior, etc.) instead of generating procedurally. Set false to force procedural generation even when templates exist",
      +  "type": "boolean"
      +}
  3. Addedv5.8.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly=false, idempotent=false, destructive=false, and openWorld=false. The description adds substantial behavior: files are written immediately, failures occur on unknown themes/templates or unwritable files, duplicate mode leaves events pointing at original destinations, and non-blank modes return walkability and warnings.

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 opening is front-loaded and useful, but the body is a dense, run-on enumeration of modes and examples. Some details repeat the schema's theme and template enumerations, and the text could be more scannable for a tool with seven modes and twenty-four parameters.

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?

With no output schema, the description still covers return shapes such as mapId, seed, markers, walkability, warnings, and batch mapIds. It also states prerequisites, side effects, and failure conditions, making it complete for a highly complex map-generation tool.

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%, but the mode parameter's schema explicitly says 'see the tool description', so the description supplies essential semantics for mode selection and side effects. It also clarifies cross-parameter behavior for templateId, useTemplate, batch, and duplicate, though other parameter explanations largely mirror 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?

Starts with a specific verb and resource: 'Create a new map file', then states that both the file and MapInfos.json are written immediately. It distinguishes itself from siblings like edit_map and query_map by explaining the creation pipeline and mode-specific behavior without requiring the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent by mode, states prerequisites such as running manage_system action 'mine_templates' first, and names alternatives including edit_map fill_layer and get_project_context. When-not conditions are not exhaustively enumerated, but the mode-by-mode guidance is exceptionally clear.

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