Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DOS2GM_GAMENoPath to the game folder. If not set, it is found automatically.
DOS2GM_MODSNoPath to the Mods folder in the game's documents. If not set, it is found automatically.
DOS2GM_DIVINENoPath to Divine.exe. If not set, it is found automatically.
DOS2GM_BACKUPSNoWhere backups go. Default is ./backups../backups
DOS2GM_CAMPAIGNSNoPath to the GMCampaigns folder. If not set, it is found automatically.
DOS2GM_OSIRIS_DATANoPath to the Osiris Data folder in the game's documents. If not set, it is found automatically.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Game Master mode campaigns of Divinity: Original Sin 2 (GMCampaigns). The campaign parameter accepts a campaign name, a folder name, a UUID, or a part of any of them.

Reading is safe at any time. Writing (dos2_put_*, dos2_delete_*, dos2_restore) is only for a closed campaign: the game is closed or sitting in the main menu. While the game process is running, writes require allow_running=true; set it only after the user has confirmed the game is in the main menu. Every write first backs up the previous files; dos2_backups lists the backups, dos2_restore brings one back.

NPCs: the easy way is to base a template on one from any campaign (dos2_find_templates → base="Campaign:Name"), then change its name, level, alignment, GM stat edits (bonus is added to the base stats), skills and items. NPCs placed in scenes live in LevelCache: they can be read (dos2_scene); scenes themselves are edited in the game.

The live layer (dos2_live_*) works in the running game through a bridge mod: it needs Script Extender, the bridge built and attached to the campaign (dos2_bridge_install), and the campaign loaded. Start with dos2_live_status: it shows what is missing.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
dos2_statusA

Reports the server's setup and lists the GM campaigns. Returns the campaigns folder, the path to Divine.exe and whether it exists, the backups folder, whether the game process is running, and for every campaign its name, folder, UUID, add-ons, scene count and last-modified time.

Read-only, no parameters. Call it first in a session to choose a campaign and check setup: if divine_found is
false, run dos2_fetch_lslib before any other tool. For the readiness of the running game (Script Extender,
bridge mod) use dos2_live_status instead.
dos2_fetch_lslibA

One-time setup: downloads the official LSLib release by Norbyte (Divine.exe, MIT license) from GitHub, verifies its pinned SHA-256 and unpacks it into the server's data folder. Every tool that reads or writes campaign files needs Divine.exe, so run this when dos2_status reports divine_found=false.

Needs internet access. Writes only into the data folder; the game and the campaigns are not touched. When
Divine.exe is already there it returns at once without downloading. Returns {result, source}, or {error} on a
network failure or checksum mismatch (then nothing is unpacked).
dos2_campaignA

Reads one campaign and returns a compact overview: metadata and attached add-on mods, scenes, Overview maps with their pins, vignettes (uuid, title, answers), NPC and item templates (kind, name, level), sticky notes (title, kind, folder) and the whole journal.

Read-only. Use it to orient yourself before reading details or editing. For full content follow up with
dos2_scene (who stands in a scene), dos2_template (one template), dos2_vignettes or dos2_notes. To pick a
campaign in the first place use dos2_status.
dos2_campaign_metaA

Changes the campaign's name, description and author in meta.lsf, the same fields the game edits in its campaign settings. Only the fields you pass are changed. With none of them given nothing is written and the current metadata is returned.

The campaign folder keeps its name, because the game identifies the campaign by it. The previous file is backed up first; undo with dos2_restore.
Fails with an error while the game process is running unless allow_running=true. Returns the backup id and the resulting metadata.
dos2_sceneA

Reads what the Game Master has placed in one scene, from the campaign files (LevelCache): characters with name, root template, position, vitality, experience, alignment and encounter; encounters with their members; the item count; the scene's sticky notes.

Read-only, and it shows the saved state, not a running game: for the live level use dos2_live_characters. Placed
characters cannot be edited through files; change them in the game or with the dos2_live_* tools. Fails with an
error if the scene has never been loaded in the game (it has no LevelCache file yet).
dos2_templatesA

Lists the campaign's saved Game Master templates (the "Creatures and Items" panel, stored in Eggs.lsf) as short summaries. NPC entries have name, stat_name, template_id, level, alignment, skills and item stats ids; item entries have name, stats_id, template_id and level.

Read-only. Use dos2_template to get one template in full, and dos2_find_templates to search by substring across
all campaigns, including Larian's sample ones.
dos2_templateA

Returns one saved Game Master template of the campaign in full: for an NPC its base stats, the GM's stat edits, abilities, talents, skills, skill bar and items with slots; for an item all of its attributes.

Read-only. Fails with an error when the campaign has no template with that name. Use it to inspect a template
before changing it with dos2_put_npc_template or dos2_put_item_template. To list the available names use
dos2_templates; to search across campaigns use dos2_find_templates.
dos2_find_templatesA

Searches saved Game Master templates in every campaign on disk (or in one) and returns matching summaries with the campaign each one lives in. Larian's sample campaigns are included, so this works as a library of ready NPCs.

Read-only. Use it to find a template to copy: pass a hit to dos2_put_npc_template as base="Campaign:Name". To
list one campaign's templates without searching use dos2_templates.
dos2_vignettesA

Returns every vignette of the campaign with its full content: uuid, title, text, question, answer options, image and folder. Vignettes are the illustrated story cards the Game Master shows to players, optionally with a vote.

Read-only. When titles are enough, dos2_campaign is cheaper. Create or change a vignette with dos2_put_vignette
and remove one with dos2_delete_vignette.
dos2_notesA

Returns all Game Master sticky notes of the campaign with their full text. Each note has uuid, title, text, folder and kind: a "map" note sits on an Overview map (map UUID, x and y in map pixels), a "scene" note is bound to an object inside a scene (scene ID and the bound object). Players never see these notes.

Read-only. When titles are enough, dos2_campaign is cheaper. Create or change a note with dos2_put_note and
remove one with dos2_delete_note.
dos2_rawA

Converts any binary campaign file (.lsf) to LSX text and returns it, whole or filtered by XPath. This is the escape hatch for exploring data the other tools do not expose.

Read-only. Prefer the structured tools (dos2_campaign, dos2_scene, dos2_template, dos2_vignettes, dos2_notes)
when they cover the need: raw files are large. With xpath the output starts with a match count; output longer
than max_chars is truncated with a note. Fails with an error if the file does not exist in the campaign.
dos2_put_npc_templateA

Creates a saved NPC template in the campaign (the Game Master's "Creatures and Items" panel), or changes the one that already has this name. The usual way is to copy a ready NPC with base and adjust it: name, level, alignment, GM stat edits, skills, items. Parameters you omit keep the base's values.

Writes Eggs.lsf. The previous file is backed up first; undo with dos2_restore. Fails with an error while the game process is running unless allow_running=true.
The template only defines what the GM can place: it does not put a character into a scene (place it in the game,
or use dos2_live_spawn). Returns created (true for a new template), the resulting template in full and the
backup id. For item templates use dos2_put_item_template.
dos2_put_item_templateA

Creates a saved item template in the campaign (the Game Master's "Creatures and Items" panel), or replaces the one with the same name. Use it for quest items, readable notes and books, and custom weapons or armor the GM hands out.

Writes Eggs.lsf. The previous file is backed up first; undo with dos2_restore. Fails with an error while the game process is running unless allow_running=true.
Returns created (true for a new template), a summary of the template and the backup id. For NPC templates use
dos2_put_npc_template; to give an NPC template items, pass them in its items parameter instead.
dos2_put_journalA

Replaces the campaign's whole Game Master journal (categories, chapters, paragraphs) with the structure you pass. Entries that are not in categories are removed, so read the current journal with dos2_campaign first and send it back with your changes.

Writes Journal.lsf. The previous file is backed up first; undo with dos2_restore. Fails with an error while the game process is running unless allow_running=true.
The shared flag was not verified against Larian's samples; the GM can also share entries in the game. Returns
the backup id and the journal as it now reads.
dos2_scene_settingsA

Changes the settings of one scene in GMScenes.lsf: its name, folder, atmosphere (lighting and weather), ambient sound and music. Only the fields you pass change; an empty string resets that field to the level's default.

It does not change what is placed in the scene: characters and items are placed in the game or with the
dos2_live_* tools. The previous file is backed up first; undo with dos2_restore. Fails with an error while the game process is running unless allow_running=true.
Returns the backup id and the scene entry as it now reads.
dos2_delete_templateA

Deletes a saved NPC or item template from the campaign by name. If an NPC template and an item template share the name, both are removed. Characters already placed in scenes from that template stay as they are.

Writes Eggs.lsf. The previous file is backed up first; undo with dos2_restore. Fails with an error while the game process is running unless allow_running=true.
Fails with an error when no template has that name. Returns the number of templates removed and the backup id.
dos2_put_vignetteA

Creates a vignette (an illustrated story card the Game Master shows to players, optionally with a vote), or replaces an existing one. The vignette to replace is found by key if given, otherwise by an equal title; otherwise a new one is created.

Writes Vignettes.lsf and, with image, copies the picture into the campaign's Vignettes/Illustrations. The previous file is backed up first; undo with dos2_restore.
Fails with an error while the game process is running unless allow_running=true. Fails with an error if the image file does not exist. Returns created, the vignette's uuid, the image
name and size, and the backup id. Read existing vignettes with dos2_vignettes.
dos2_delete_vignetteA

Deletes one vignette from the campaign, found by UUID or exact title. Its picture files stay in the campaign's Vignettes/Illustrations folder, so other vignettes that use the same image keep working.

Writes Vignettes.lsf. The previous file is backed up first; undo with dos2_restore. Fails with an error while the game process is running unless allow_running=true.
Fails with an error when nothing matches. Returns the UUIDs removed and the backup id.
dos2_put_noteA

Creates a Game Master sticky note on an Overview map, or changes an existing note. Players never see these notes. An existing note is found by key if given, otherwise by an equal title; if none matches, a new one is created on the map.

A note inside a scene hangs on an invisible marker item of the level, so new scene notes have to be placed in
the game; for one that already exists this tool changes title, text and folder and keeps its binding.

Writes Notes.lsf. The previous file is backed up first; undo with dos2_restore. Fails with an error while the game process is running unless allow_running=true.
Fails with an error if the map is not found or has to be specified. Returns created, the note's uuid, where it
sits and the backup id. Read notes with dos2_notes; remove one with dos2_delete_note.
dos2_delete_noteA

Deletes one Game Master sticky note from the campaign, found by UUID or exact title. Works for notes on an Overview map and for notes bound to an object in a scene.

Writes Notes.lsf. The previous file is backed up first; undo with dos2_restore. Fails with an error while the game process is running unless allow_running=true.
Fails with an error when nothing matches. Returns the UUIDs removed and the backup id. To change a note's text
instead, use dos2_put_note.
dos2_backupA

Copies the entire campaign folder into the backups folder as a new backup labelled "full". Nothing in the campaign changes, and it is safe while the game is running.

Every write tool already backs up the files it touches, so use this for a complete snapshot before a risky
series of edits or before a play session. Returns the backup id and its path. List backups with dos2_backups
and bring one back with dos2_restore.
dos2_backupsA

Lists the campaign's backups, newest first. Each entry has the id (timestamp plus operation label, e.g. "...-npc-template" or "...-full"), the label, the files that were saved, and the files that the operation created.

Read-only. Use it to find the id to pass to dos2_restore when an edit has to be undone. Returns an empty list
when the campaign has no backups yet.
dos2_restoreA

Undoes an earlier write: puts back the files saved in the given backup and deletes the files that the backed-up operation had created. Restoring a "full" backup brings back every file of the campaign.

The current state of the affected files is itself backed up first under the label "before-restore", so a
restore can be undone too. Fails with an error while the game process is running unless allow_running=true. Fails with an error when the backup id does not exist. Returns the id of
the before-restore backup and restored_from.
dos2_live_statusA

Checks everything the live tools (dos2_live_*) need and reports what is missing: whether the game is running, whether Script Extender is installed next to the game and its settings, whether the bridge mod .pak is built, which campaigns have it attached, and whether the bridge's heartbeat is coming in (it writes one about every 2 seconds while a campaign is loaded in Game Master mode).

Read-only, no parameters. Call it before the first live tool of a session and whenever a live tool times out.
If the bridge is not built or attached, run dos2_bridge_install with the game closed. For file-level setup
(campaign list, Divine.exe) use dos2_status.
dos2_bridge_installA

Builds this server's bridge mod into the game's Mods folder (DOS2GMBridge_....pak, overwriting the previous build) and, when campaign is given, adds it to that campaign's add-ons in meta.lsf. The bridge is what the dos2_live_* tools talk to; it needs Script Extender in the game.

The previous file is backed up first; undo with dos2_restore. Attaching: Fails with an error while the game process is running unless allow_running=true.
In multiplayer every player needs the same .pak and Script Extender, as with any add-on; after a rebuild, send
them the new file. Returns the .pak path, the packed files and the campaign's add-on list. Check the result
with dos2_live_status; remove with dos2_bridge_detach.
dos2_mod_installA

Packs your own mod from a source folder into the game's Mods folder as .pak (overwriting a previous build) and, when campaign is given, adds it to that campaign's add-ons. UUID, name, version and folder come from the mod's meta.lsx.

Use it for mods you develop yourself; for a ready third-party .pak use dos2_addon, and for this server's bridge
use dos2_bridge_install. Fails if PublishVersion in meta.lsx is below a Definitive Edition editor version (use
909321303): the game would mark the mod as Classic and refuse it. The previous file is backed up first; undo with dos2_restore. Attaching: Fails with an error while the game process is running unless allow_running=true.
Returns the .pak path, packed files, module name and UUID, and the add-on list.
dos2_addonA

Attaches a ready-made mod from a .pak file to the campaign as an add-on, or detaches it with attach=false. On attach the file is copied into the game's Mods folder; UUID, name, version and folder are read from the meta.lsx inside the pak. Detaching leaves the .pak in Mods.

Writes meta.lsf. The previous file is backed up first; undo with dos2_restore. Fails with an error while the game process is running unless allow_running=true.
Players need the same .pak, as with any add-on. Fails if the file is missing or holds no single meta.lsx.
Returns the module name, author, UUID, the .pak path and the campaign's add-on list. To build a mod from a
source folder use dos2_mod_install.
dos2_bridge_detachA

Removes this server's bridge mod from the campaign's add-ons in meta.lsf. After that the dos2_live_* tools no longer work for this campaign, and players no longer need the bridge .pak. The .pak itself stays in the game's Mods folder, and nothing happens if the bridge was not attached.

The previous file is backed up first; undo with dos2_restore. Fails with an error while the game process is running unless allow_running=true.
Returns the backup id and the campaign's add-on list. Attach again with dos2_bridge_install.
dos2_live_charactersA

Lists the characters on the level currently loaded in the running game, player characters included: GUID, name, root template, stats entry, level, vitality, alignment and position. With near it returns only those within radius of that character.

Read-only; needs the game running with the bridge mod (see dos2_live_status), otherwise it fails with a timeout
error. Use it to get GUIDs and positions for dos2_live_move, dos2_live_set, dos2_live_stage and
dos2_live_spawn. For what is saved in the campaign files rather than the running game, use dos2_scene.
dos2_live_spawnA

Creates a new character on the level loaded in the running game, at a point or next to another character. Each call adds one more character, so repeating it makes duplicates; take one away with dos2_live_stage.

From a GM template only the model, level, alignment and name are used: its stat edits, skills and items are NOT
applied this way (placing it from the game's "Creatures and Items" panel applies them). During the Game Master
pause the character is created at once but moves into place only after unpausing: the result then has
applies_on_unpause=true and its position still reads 0, 0, 0. Needs the bridge (see dos2_live_status). Returns
the new character's GUID and state.
dos2_live_moveA

Teleports one character on the live level to the point x, y, z, or next to another character with the offset dx, dz. Works on NPCs and on player characters.

Changes only the running game, not the campaign files. During the Game Master pause the move is applied after
unpausing (the result has applies_on_unpause=true). Fails with an error when who matches no character or more
than one (then pass a GUID), or when neither a full x, y, z nor near is given. Needs the bridge (see
dos2_live_status). Get positions from dos2_live_characters.
dos2_live_setA

Changes a character that already stands on the live level: its displayed name, its level and its alignment towards the party. Only the fields you pass change.

Changes only the running game, not the campaign files or the template the character came from. Setting
alignment to "Evil NPC" makes the character hostile, which can start combat. Fails with an error when who
matches no character or more than one (then pass a GUID). Needs the bridge (see dos2_live_status). Returns the
character's new state. To move a character use dos2_live_move; to hide one use dos2_live_stage.
dos2_live_stageA

Takes a character on the live level off stage or brings it back. An off-stage character is invisible and takes no part in the scene but stays in the level with its state, so this is the reversible way to remove an NPC or to prepare one for a later entrance; nothing is deleted.

Changes only the running game. Fails with an error when who matches no character or more than one (then pass a
GUID). Needs the bridge (see dos2_live_status). Returns the character's new state.
dos2_live_luaA

Runs arbitrary Lua on the game server through Script Extender, in the bridge mod's context, and returns the value of its return statement. The Ext and Osi APIs are available. This is the escape hatch for anything the other live tools do not cover: items, statuses, combat, level changes.

It can change or break anything in the running session, so prefer the dedicated tools (dos2_live_characters,
dos2_live_spawn, dos2_live_move, dos2_live_set, dos2_live_stage) when they fit. The returned value must be
JSON-serializable. Lua errors come back as an error with the message; a call that outlives timeout fails. Needs
the bridge (see dos2_live_status). Do not call Osi functions while a level is still loading.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.1/5.0

Scored across 34 tools

Disambiguation4/5

Despite 34 tools, near-collisions are explicitly disambiguated in the descriptions: dos2_status vs dos2_live_status (file setup vs running game), dos2_templates/dos2_template/dos2_find_templates (list/one/search), and dos2_bridge_install/dos2_mod_install/dos2_addon (own bridge vs own source mod vs third-party pak). The read-vs-write and file-vs-live split (dos2_scene vs dos2_live_characters, dos2_put_npc_template vs dos2_live_spawn) is also spelled out. A few pairs (dos2_campaign vs the specific readers, create-or-replace put_* tools) still require reading carefully, so not a perfect 5.

Naming Consistency4/5

Everything is snake_case under a uniform dos2_ prefix, with recognizable sub-namespaces (dos2_live_*, dos2_put_*, dos2_delete_*). The pattern is verb_noun for mutations and bare noun for reads (dos2_campaign, dos2_notes, dos2_raw), which is systematic but means read tools have no verb, and dos2_addon/dos2_backup are verbless outliers. Minor deviations only; names remain predictable.

Tool Count3/5

34 tools is heavy, but the server genuinely spans three subsystems: campaign file read/write, backup/restore, and live-game control plus mod packaging. Each tool does correspond to a real operation, yet the surface is large enough that an agent must triage setup, backup, file and live groups before acting. Borderline-heavy rather than bloated.

Completeness4/5

Coverage is strong: full CRUD for templates, vignettes and notes, campaign metadata, scene settings, journal, backup/list/restore with undo-of-undo, add-on management, and live spawn/move/set/stage/characters with a Lua escape hatch. Remaining gaps are deliberate and documented (journal is whole-file replace only, scene notes cannot be created from files, scenes/placed characters must be created in-game), which agents can work around but not eliminate.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues