Skip to content
battlemap-mcp docs
You're reading the docs for battlemap-mcp v1.3.1, an earlier release. See this page in the latest docs.

Inspect and edit elements

Generated from battlemap-mcp v1.3.1. Your assistant gets these same names, descriptions and parameters from the server when it connects; the server is named battlemap, so a client may show a tool as battlemap:ping or similar.

list_elements

List elements currently on the map with their ids, positions, rotation, scale and asset.

Use the returned ids with move_element / modify_object / delete_element / select_elements.

Objects carry bounds, [x0, y0, x1, y1] in woxels after scale and rotation: where the canvas reaches.

total is how many elements of this kind exist, count how many came back, and truncated says plainly that there are more. Read total, not count, before concluding anything about the whole map.

ParameterTypeDefaultDescription
kindstring"objects"one of 'objects', 'walls', 'lights', 'paths', 'portals', 'roofs', 'texts'.
limitinteger200
include_pointsbooleanfalsealso return each wall's and path's polyline. Walls and paths are shapes, not points — without this they report a meaningless single position (a real hand-built map lists every wall at [0, 0]). Off by default because a map can hold hundreds of paths and the coordinates swamp the listing; get_element always includes them for one element.
offsetinteger0skip this many before returning, for paging through a large map.
include_boundsbooleanfalsegive objects opaque_bounds too, as get_element does. It reads every texture's pixels once, so ask only when fitting something.

get_element

Get details (kind, position, rotation, scale, asset) for a single element by id.

Objects carry bounds and opaque_bounds, [x0, y0, x1, y1] in woxels after scale and rotation. bounds is the asset's whole canvas; opaque_bounds is the part its art actually covers. Fit a bed, rug or shadow to the opaque bounds of the objects it goes under, not to their positions.

ParameterTypeDefaultDescription
id requiredinteger

get_composition_snapshot

Describe the current map's spatial structure for generation or review.

Returns map bounds, a fixed 3-by-3 grid, every kind's element count, occupied grid cells, and geometric bounds. It is a compact factual summary of the map currently open in Dungeondraft, not an aesthetic score or a substitute for a whole-map export and focused screenshot.

No parameters.

move_element

Move any element to a new woxel position by id.

scatter_objects stays loose unless you pass snap.

ParameterTypeDefaultDescription
id requiredinteger
x requirednumber
y requirednumber
snapstring""'none', 'grid' or 'auto'; see get_snap_settings. Detail placed by

move_elements

Move many elements by the same offset, in one call and ONE undo step.

Use it for anything that moves as a group: a prefab (its ids come back from place_prefab), a scattered cluster, a furnished corner. Moving them one at a time costs a call and an undo slot each.

dx, dy: offset in woxels (256 = one tile).

Walls keep their saved geometry and carry mounted doors/windows with them. Duplicate ids move once. Text anchors move while labels stay upright. Cave-generated walls and mounted portals without their wall are reported in unsupported, with reasons. Returns moved, missing, unsupported, the applied offset/rotation and pivot. Inspect these before repeating a prefab.

ParameterTypeDefaultDescription
ids requiredinteger[]element ids, up to 1000.
dx requirednumber
dy requirednumber
rotationnumber0optional degrees around the group geometry's bounding-box centre, or around pivot_x/pivot_y when both are supplied; translation follows.
pivot_xnumber | nullnull
pivot_ynumber | nullnull
snapstring""rounds dx, dy to the nearest whole grid steps; see get_snap_settings. A group of only scatter_objects detail stays loose unless you pass snap.

delete_element

Delete any element from the map by id. Reversible with undo().

The element is detached rather than destroyed, so undo() puts it back exactly where it was, with its id intact.

To take back what a place_prefab, scatter_objects or build_room just made, call undo() once instead of deleting its pieces: each of those is ONE undo step, but only while it is still the latest undoable operation. Anything done since has to be undone first, which may not be what you want.

It leaves the map on the NEXT frame, so a get_status immediately after may still count it. Read the count back a moment later, not in the same breath.

Terrain, water and floor shapes are layers, not elements: they have no id and cannot be deleted. Paint over them, or draw them again with invert.

ParameterTypeDefaultDescription
id requiredinteger

delete_elements

Delete many elements in ONE call and ONE undo step. Reversible with undo().

Deleting one at a time costs a call and an undo slot each, and a large group can push everything built before it out of the history's reach.

Before reaching for this on something you just created: a place_prefab, scatter_objects, place_objects or build_room call is already a single undo step, so undo() takes the whole thing back while it is the latest operation. Use this for elements from different calls, or older work.

Up to 100 ids. Every id is resolved before anything is deleted: if one is unknown the batch changes nothing and names it, rather than leaving you to work out how far it got.

ParameterTypeDefaultDescription
ids requiredinteger[]

select_elements

Select the given element ids in Dungeondraft's UI (replaces the current selection).

ParameterTypeDefaultDescription
ids requiredinteger[]

clear_selection

Clear the current selection in Dungeondraft.

No parameters.

get_recent_nodes

List the ids Dungeondraft has assigned to nodes it created, newest last.

Use this to learn the ids of things you did NOT place one at a time — the contents of a prefab, everything a generated dungeon produced. Without it those can only be counted, not moved, modified or deleted.

Pass since from a previous call's next_since to get only what is new. dropped_older means the log wrapped and some ids were lost — read it more often, or take the ids straight off place_prefab / generate_dungeon, which report their own.

ParameterTypeDefaultDescription
sinceinteger0return assignments after this sequence number (0 = everything held).
limitinteger200maximum rows to return.