Skip to main content
Glama

Turn a region into a battle zone

make_encounter_zone
DestructiveIdempotent

Paint a map region, create its troop groups, and attach weighted encounter rows in one call, preventing broken or empty random encounters in RPG Maker MZ.

Instructions

Paint a region, make the troops, and attach the encounter rows in one call. A zone is three writes across two files (layer 5 of the map, then the map's encounter list) plus a Troops row per group, and the row shapes are exactly the ones that break a game when they are guessed: MZ reads regionSet unconditionally, so a row without that array throws inside Scene_Map on its first roll and freezes the map mid-walk, and a row without weight makes the weight sum NaN so that no row on the map ever rolls. A troop entry either names an existing troopId or lists enemies (ids, or {id, level?, x?, y?}), and the row is cloned from a real troop so its member shape matches what the editor writes. Region 0 means the whole map. The reply calls out any row whose region no cell carries, because that is the mistake that makes a zone feel empty rather than broken.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mapIdYes
regionNoPaint the region on layer 5; omit to keep whatever is already painted
troopsYesThe battle groups that can appear here
clearRegionNoErase this region id from the whole map first, so a re-run does not leave the old paint behind
keepExistingNoAdd to the map's current encounter rows instead of replacing them
encounterStepNoSteps the player walks between encounter rolls on this map (default 20; MZ's new maps use 30)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.2

TDQS

A4.3/5.0
Behavior5/5

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

It goes well beyond the annotations by disclosing concrete failure modes: MZ reads regionSet unconditionally so a row without it throws inside Scene_Map and freezes the map, and a missing weight produces a NaN sum that blocks all rolls. It also explains replacement vs additive behavior and that the reply flags orphaned regions, all runtime consequences an agent cannot infer.

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

Conciseness4/5

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

Front-loaded with the core action and structured as what-it-does followed by why-the-shapes-matter warnings. The prose is dense and vivid ('freezes the map mid-walk'), which mostly earns its place as load-bearing caution, though a few phrasings could be tightened.

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 6-parameter, nested, multi-file mutation with no output schema, the description covers inputs, failure modes, clearing, and even the reply's diagnostic callout. It omits explicit return structure, but the mention of what the reply reports partially fills that gap.

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 83%, so the baseline is 3, but the description adds real semantics: region 0 means the whole map, a troop entry either names an existing troopId or lists enemies, and rows are cloned from a real troop so member shape matches the editor. These clarify nested-parameter intent beyond the schema descriptions.

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 opening sentence names a specific composite action and its parts: 'Paint a region, make the troops, and attach the encounter rows in one call.' It clearly distinguishes itself from siblings like make_battle and make_map by describing the three coordinated writes across two files.

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

Usage Guidelines3/5

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

The description implies when to use it ('in one call' composite of region + troops + encounter rows) and hints at re-run behavior via clearRegion, but never names alternatives or states when NOT to use it versus make_battle or set_map_properties. Usage is inferable rather than explicit.

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