save_map
Save the open Dungeondraft map to disk so progress survives a crash. Omit the filename to overwrite the current map, or pass a new one to write a separate file.
Instructions
Save the map. Use this often — it is how work survives a crash.
filename: a bare name (".dungeondraft_map" is added if missing), written
into the configured save directory — see get_save_directory. Omit it to
save over the map already open.
The map you have open can always be overwritten; that is the point, and it
is how you check in progress as you go. A file that EXISTS and is not your
open map is refused, so a plausible-sounding name cannot destroy someone
else's map. Pass overwrite=True only when the user has actually asked to
replace that file.
A map that has never been saved has no path, so saving it needs a filename:
without one Dungeondraft opens a modal Save As dialog, and a modal freezes
this bridge until a human closes it.
Writing is asynchronous, so by default this waits until Dungeondraft
reports it finished writing THIS path and returns `completed: true`. While
a save is in flight Dungeondraft DROPS edits from the file, so the bridge
refuses to change the map until it lands.
`completed: false` means the save did not confirm in time. It is probably
still running: read `note`, poll get_status, and do NOT call save_map
again — a second write of the same file is the one thing that cannot help.
wait=False returns as soon as the save starts, for a caller that tracks
`saving.in_flight` itself.
If Dungeondraft does not start a save at all, this raises instead of
replying. Read the message, because the two causes need opposite action:
busy (retry in a few seconds), or wedged after a save crashed inside
Dungeondraft — then nothing can be written this session, a restart is the
only way out and it loses unsaved work, so stop building and tell the user.
Any edit made while a save is unfinished also carries a `save_warning`.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "save_map"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wait | No | ||
| filename | No | ||
| overwrite | No |