Skip to main content
Glama

crop_map

Crop a battle map to a chosen tile window, preview elements outside or crossing the edge, and confirm to save with a backup and remove out-of-bounds content.

Instructions

Crop the map to a window of TILES, rect=[x, y, w, h], from any side.

The tile at (x, y) becomes the new top-left and everything moves with it.
Choose the window with the user first: keep the focal area, routes and
whole rooms (get_composition_snapshot, then screenshot or fit_elements).

Without confirm this only previews: the new size, and per kind the ids of
what lies wholly outside (`outside`, deleted on confirm) and what crosses
the edge (`crossing`, kept as it is: a wall or path running off the map
is not cut, so mention it, and delete or redraw it if the user wants).
Patterns cannot be listed, so a pattern outside stays, off the map.

confirm=true saves the map and copies the file beside it (`backup`), since
a crop cannot be undone, then crops through Dungeondraft's own resize and
deletes what was outside, one undo step per 100 (`undo_steps`). Earlier
undo history is cleared, because every element moved. If a step fails the
reply says `changed: "partial"` or `"unknown"` with what is left: follow
its `next`, never just call crop_map again. Only the current level is
cleaned of what lies outside; every level is cropped.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "rect": "<rect>"
    },
    "name": "crop_map"
  }
}

Input Schema

NameRequiredDescriptionDefault
rectYes
confirmNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.5.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so: preview returns new size plus per-kind `outside` (deleted) and `crossing` (kept, for walls/paths running off the map) ids, patterns can't be listed so they persist off-map, confirm writes a backup file, crops via Dungeondraft's resize, one undo step per 100, clears earlier undo history, and only cleans the current level while cropping all levels.

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?

Purpose and rect format are front-loaded, and nearly every sentence adds operational value. It is dense and parenthetical-heavy — the nested explanation of `outside`/`crossing` and pattern behavior takes close reading — but little could be cut without losing safety-relevant detail.

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?

For a destructive, irreversible mutation with no annotations and no output schema, the definition covers preview semantics, element fate, backup creation, undo accounting, and partial/unknown failure states with a pointer to a `next` field. Nothing an agent needs to call it safely is missing.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate and does: rect is explained as a tile-coordinate window [x, y, w, h] with the top-left tile anchoring the move, and confirm is fully specified as preview-only by default versus file-saving, destructive confirmation.

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 and resource — crop the map to a tile window given as rect=[x, y, w, h] — and clarifies that the tile at (x, y) becomes the new top-left. An agent can immediately distinguish this mutation from read-only siblings like get_composition_snapshot or screenshot, which it cites as preparation steps.

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?

Gives explicit workflow guidance: pick the window with the user first, keeping the focal area, routes, and whole rooms, via get_composition_snapshot then screenshot or fit_elements. It also states the confirm=false vs confirm=true split and warns never to just re-call crop_map after a partial failure — a real when/when-not distinction.

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

Deploy Server

Other Tools