Skip to main content
Glama

manage_map_event

Destructive

Create, change or remove map events; the map file is written immediately. action "create" without preset makes a bare event at x/y (empty page unless pages; then use add_command or insert_event_commands).

Instructions

Create, change or remove map events; the map file is written immediately. action "create" without preset makes a bare event at x/y (empty page unless pages; then use add_command or insert_event_commands). With preset it builds a ready event: "npc" {name, dialogues[], characterName?, characterIndex?}; "chest" one-time loot {items: [{type item|weapon|armor, id, amount}]}; "teleport" walk-on transfer {destMapId, destX, destY, trigger?}; "door" action-button warp {destMapId, destX, destY, characterName?, characterIndex?, trigger?, lockedSwitchId?, lockedMessage?}, locked until that switch is ON; "shop" {goods: [[type 0 item/1 weapon/2 armor, id, priceType 0 standard/1 custom, price]]}; "inn" {cost?}; "boss" {troopId} one-time battle, game over on loss; "puzzle_switch" {switchX, switchY, doorX, doorY, gameSwitchId, switchName?, doorName?} makes two linked events. A missing destination map, troop, item or switch is refused; an unwalkable or occupied tile is created anyway and listed in warnings. "update" overwrites only fields. "convert" keeps an event's id, position, name and sprite but replaces its behaviour via kind: "merchant" (options.goods, or options.items [{type, id}], options.greeting?), "inn" (options.cost?), "sign" (options.text). "delete" removes it (destructive). "add_command" appends one command before a page's end. "populate" scatters N npc/chest/boss events on random free tiles of the main walkable area of the map (explicit opts.x/opts.y are used as given). Returns the event(s) with ids; fails if the map or event does not exist.

Input Schema

NameRequiredDescriptionDefault
xNoTile X position (0-based; create/presets except puzzle_switch)
yNoTile Y position (0-based)
costNopreset "inn": gold charged for a full recovery (default 50)
kindNoaction "convert": what to turn the existing event into
nameNoEvent name shown in the editor
optsNoaction "populate": overrides {name, troopId, x, y}
countNoaction "populate": how many events (default 3)
destXNopreset "teleport"/"door": destination tile X (should be walkable)
destYNopreset "teleport"/"door": destination tile Y
doorXNopreset "puzzle_switch": door tile X
doorYNopreset "puzzle_switch": door tile Y
goodsNopreset "shop": wares [[type, id, priceType, price]] — priceType 1 uses the custom price, 0 the database price
itemsNopreset "chest": loot [{type: "item"|"weapon"|"armor", id, amount}]
mapIdYesMap the event lives on (always required)
pagesNoaction "create" without preset: full event page objects (optional)
actionYesWhat to do; see the tool description. Default "create"
fieldsNoaction "update": properties to overwrite, e.g. {"x": 5, "y": 9} or {"pages": [...]} (replaces all pages)
presetNoaction "create" only: ready-made event recipe; omit for a low-level empty event
commandNoaction "add_command": event command {code, indent, parameters}; e.g. 201=Transfer Player [0, mapId, x, y, dir, fade]
eventIdNoExisting event ID (update/delete/add_command); find it with query_map view "events"
optionsNoaction "convert": kind-specific settings — merchant {goods|items, greeting?}, inn {cost?}, sign {text}
switchXNopreset "puzzle_switch": floor-switch tile X
switchYNopreset "puzzle_switch": floor-switch tile Y
triggerNoHow the event activates: 0=action button, 1=player touch, 2=event touch, 3=autorun, 4=parallel
troopIdNopreset "boss" / populate boss: troop to battle (create it first via create_database_entry preset encounter_troop)
doorNameNopreset "puzzle_switch": editor name for the door event (default "Door")
destMapIdNopreset "teleport"/"door": destination map ID
dialoguesNopreset "npc": dialogue lines, each becomes one text box
eventTypeNoaction "populate": kind of events to scatter — "npc", "chest" or "boss"
pageIndexNoaction "add_command": which page receives the command (0-based, default 0)
switchNameNopreset "puzzle_switch": editor name for the switch event (default "Switch")
gameSwitchIdNopreset "puzzle_switch": game switch linking switch and door — pick an unused ID via manage_system get switches
characterNameNoSprite sheet from img/characters/ without extension; list options with get_project_context
lockedMessageNopreset "door": message shown while locked (default "It's locked.")
characterIndexNoWhich of the 8 characters in the sheet (0-7)
lockedSwitchIdNopreset "door": if set, the door shows lockedMessage until this game switch is ON, then warps

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv5.12.2
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "create",
      -  "update",
      -  "delete",
      -  "add_command",
      -  "populate"
      -]New value: +[
      +  "create",
      +  "update",
      +  "convert",
      +  "delete",
      +  "add_command",
      +  "populate"
      +]
    • addedInput schema / properties / kind
      Added value: +{
      +  "description": "action \"convert\": what to turn the existing event into",
      +  "enum": [
      +    "merchant",
      +    "inn",
      +    "sign"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / options
      Added value: +{
      +  "description": "action \"convert\": kind-specific settings — merchant {goods|items, greeting?}, inn {cost?}, sign {text}",
      +  "type": "object"
      +}
  2. Addedv5.8.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations declare destructiveHint=true and non-idempotent, and the description corroborates with 'the map file is written immediately' and 'delete removes it (destructive)'. It also discloses behaviours annotations could not: missing destination/troop/item/switch are refused, unwalkable or occupied tiles are still created but reported in `warnings`, and create/update/convert/delete vs. append semantics differ per action. Minor gap: it doesn't state permissions or whether changes are reversible.

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

Conciseness2/5

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

It is one enormous run-on sentence-plus-prose block that front-loads the verb but then buries every preset recipe, refusal rule, and action semantic in a single dense paragraph. It is informative but poorly partitioned; scanning for a specific preset or action requires re-reading the whole block, and a bullet/table structure would serve the agent far better.

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

Completeness4/5

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

For a 36-parameter, high-complexity mutation tool with no output schema, the description covers the essential decision space: which action to pick, what each preset builds, update vs. overwrite-only-fields, convert's preserved vs. replaced attributes, delete's destructiveness, and the warnings channel. What it omits – return value shape beyond 'events with ids', authorization/rate-limit context – is minor given annotations and schema coverage.

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

Parameters3/5

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

Schema description coverage is 100% and the schema already documents each parameter, including the enum meanings for action and preset and the shape of nested goods/items. The description restates the per-preset payload shapes (npc, chest, shop, door, puzzle_switch, boss) and adds cross-references like create_database_entry preset encounter_troop and manage_system get switches, but this largely echoes structured data, so baseline 3 applies.

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?

Opens with a specific verb set plus resource ('Create, change or remove map events') and immediately names the file side effect. It also enumerates every action verb (create/update/convert/delete/add_command/populate) and every preset recipe, so it is unmistakably distinct from siblings like edit_map, generate_map, and insert_event_commands.

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 clear conditional guidance throughout: when to omit `preset` vs. supply one, when to follow a bare event with add_command/insert_event_commands, what 'convert' preserves vs. replaces, and what 'populate' scatters. It notably routes the agent toward the sibling insert_event_commands, but it does not contrast itself against edit_map or query_map view 'events' for locating event ids beyond one passing mention.

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