Skip to main content
Glama

insert_event_commands

Insert validated event-command fragments into map events, common events, or troop pages. Validates boundaries/references; refuses invalid writes; supports dry-run and atomic backups.

Instructions

Insert a complete event-command fragment into a map event page, common event, or troop battle page. Validates the fragment, insertion boundary, resulting list, and supported references before writing. Invalid data refuses the write. Omit position to append before the root end marker; an explicit position must be a safe command boundary (not inside a text continuation or between a block header and its branches). Fragments are rebased to the target indentation. dryRun:true validates and previews without writing or creating backups. Normal writes use the existing atomic backup-protected project writer. Returns target identity, insertion count, the resulting list length and its command codes (listCodes), and warnings; pass verbose:true to also get the full before/after lists. Existing unknown extension commands are advisory; known MZ-only commands are rejected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mapIdNomap_event target map ID.
dryRunNoPreview the validated change without writing. Default false.
targetNoDefaults to map_event.
eventIdNomap_event target event ID.
troopIdNotroop_page target troop ID.
verboseNoInclude the full before/after command lists in the result. Default false.
commandsYesA complete fragment, typically returned by build_event_commands. A supplied final root terminator is normalized; the target always retains exactly one.
positionNoZero-based insertion index in the existing command list. Out-of-range or unsafe boundaries are rejected.
pageIndexNomap_event/troop_page: zero-based page, default 0.
commonEventIdNocommon_event target ID.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv5.19.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses pre-write validation, that invalid data refuses the write, safety rules for explicit positions, fragment rebasing to target indentation, atomic backup-protected writing, unknown vs MZ-only extension command handling, and exactly what the result contains. This is unusually rich behavioral disclosure for a mutation tool.

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?

Content is front-loaded with purpose and validation, then flows into position semantics, dryRun, writer behavior, and return values. It is dense and slightly long, but nearly every sentence carries distinct information and no sentence is pure filler.

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?

Despite having no output schema, the description enumerates the return payload (target identity, insertion count, resulting list length, listCodes, warnings, and verbose before/after lists), so an agent knows what to expect. Combined with the validation and safety rules, nothing needed to invoke it correctly is missing.

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%, so the baseline is 3, but the description adds meaning the schema lacks: the safe-boundary constraint on position, the append-before-root-end behavior when position is omitted, dryRun's write-and-backup suppression, and verbose's effect on the result shape.

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?

States a specific verb (Insert) and resource (event-command fragment) with explicit scope across three target types (map event page, common event, troop battle page). It also implicitly distinguishes itself from build_event_commands by noting fragments are 'typically returned by build_event_commands', so an agent can tell the two apart without opening the schemas.

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 operational context: omit position to append before the root end marker, use dryRun:true to preview without writing, and pass verbose:true for full lists. It does not explicitly state when to prefer this over sibling writers like edit_map or manage_map_event, which keeps it out of 5 territory.

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