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
| Name | Required | Description | Default |
|---|---|---|---|
| rect | Yes | ||
| confirm | No |