Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
WS_GAME_DIRNoGame directoryC:\Program Files (x86)\Steam\steamapps\common\War Selection
WS_LOG_PATHNoLog file or directory containing it. Defaults to <WS_GAME_DIR>\gen\, then %LOCALAPPDATA% and Documents
WS_MCP_DATA_DIRNoServer data folder: live API index, game snapshots, draft backups. Defaults to %LOCALAPPDATA%\war-selection-mcp; on Linux ~/.local/share/war-selection-mcp
WS_MCP_AUTO_SNAPSHOTNo0 disables the game snapshot on server start1

Instructions

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

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

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

Tools

Functions exposed to the LLM to take actions

NameDescription
game_infoB

Game paths (WS_GAME_DIR), engine version, number of cached mods, draft folder and log presence.

list_modsA

List mods: published cache in modsStorage (id, versions, latest, kinds, sizes) and developer-mode drafts in modsStorage/draft (draft field). Optional substring filter on id.

get_modB

Source of a mod. mod_id like 'mod-6gqH17D5rDl' or '6gqH17D5rDl'; version defaults to latest; kind 'lua' or 'prm'. source: 'auto' (developer-mode draft in modsStorage/draft if present, else published cache), 'draft' or 'cache'.

search_mod_codeB

Regex search (case-insensitive) across cached mod code and drafts; returns file:line with context lines.

game_data_queryB

Query Cache/Projects/WarSelection JSON (gameplay, visual, legacyIds, preload, styles, main, render, interfaces/...). Use path like 'build[10].costBuilding' or 'auras.0', or key_search (regex over keys and string values).

search_apiA

Search the API index: the live dump imported with import_api_dump (current engine) when present, with the bundled index as fallback (wsunitstats.com WSUS tree v258.4018 + verified notes from the api-cheatsheet). kind: 'function', 'event', 'field' or 'note'. Result index shows which is active.

search_guideA

Search the bundled Russian modding guide (guide-ru.md); returns section, line and snippet.

read_logB

Tail of a game log (default gen/log.txt; also log_prev.txt, lagDiagnostics.log, ...) searched in likely locations; optional regex filter. Reports clearly where it looked if the log is missing. WS_LOG_PATH overrides the location.

lint_modA

Static check of mod Lua code (pass code, or mod_id of a cached mod): Lua 5.4 syntax plus known War Selection pitfalls (math.random in gameplay mods, missing root.f_recreateModifiedUnitTypes(), visual mods changing game state, math.atan2, removed/renamed functions, unknown addMod events, undefined handlers, unknown f_* names with suggestions). kind: auto | gameplay | visual. With mod_id, source: auto (draft if present, else cache) | draft | cache.

diff_modA

Unified diff between two cached versions of a mod (default: previous vs latest). draft=true compares published version v1 (default latest) with the developer-mode draft in modsStorage/draft.

log_errorsA

Parse Lua errors in gen/log.txt ('Lua program ... run (Error) failed' blocks and [string "..."]:N: lines), group repeats, and map them to cached mods (chunk preview match + mods active at that moment). tail limits to the last N log lines; since is 'YYYY-MM-DD[ HH:MM[:SS]]' in log time.

find_examplesB

Real usages of an API name across cached mods with file:line context, e.g. 'f_addCircle', 'landscape.zones.f_addCircle', 'root.f_recreateModifiedUnitTypes'. Underscore paths are matched too.

list_events_usageA

Which addMod events each cached mod registers (latest versions), with totals per event. Optional event filter, e.g. 'onUnitInZone'.

scaffold_modA

Starter code built from guide recipes taken from working mods (returned, never written). Call without template to list templates: blank_gameplay, blank_visual, zone_trigger, unit_death, special_command_pair, unit_stat_tweak.

unit_lookupA

Find unit types by legacy id or asset path substring (legacyIds.json) with their build rules from gameplay.json (cost, health). Example: 'worker', '201', 'airplane'.

api_dump_scriptA

Lua script for the in-game developer console / a dev-mode mod that dumps the root API tree into gen/log.txt as WSDUMP lines (read-only: indexes fields under pcall, never calls f_* functions). root: start path ('root', 'root.unitType[0]', 'root.session.visual'); space: 'gameplay' (gameplay mod root) or 'visual' (visual mod root). seeds=true embeds known names from the active index so removed names are detected even if the engine does not allow pairs(). compact=true returns one line for the console. Arrays are sampled (array_sample elements) and written as []. Then call import_api_dump.

import_api_dumpA

Parse WSDUMP lines from gen/log.txt (or which='log_prev.txt', or an explicit file), build the live API index and report the diff against the bundled WSUS v258.4018 index (added / removed / changed paths, unexplored subtrees to dump next). Writes only to the per-user data folder (WS_MCP_DATA_DIR, default %LOCALAPPDATA%/war-selection-mcp), never to the game folder. Dumps of different subtrees are merged; a new engine version replaces the old index (backup kept). dry_run=true writes nothing. A dump without END is refused unless allow_partial=true.

api_index_statusA

Which API index is active (live dump or bundled), its engine version, entry counts, imported dumps, and whether it is stale compared to engine-version.txt in the game folder.

snapshot_gameA

Store a snapshot of the game state in the user data folder (never the game folder): hashes of all Cache/Projects/WarSelection JSON files and engine-version.txt, normalized content of gameplay.json, visual.json, legacyIds.json, main.json, render.json, preload.json, and the active API index. Skipped when nothing changed since the latest snapshot unless force=true. Also taken automatically on server start.

diff_game_versionsA

Structured diff between two snapshots (default: previous vs latest; a/b accept a snapshot id, id prefix or engine version). Sections: changed files, unit types (legacyIds), build rules (cost, health, ...), researches and upgrades, auras, unit overrides, API index added/removed/changed signatures. Takes a new snapshot first if the game changed. With a single snapshot it explains that the next update produces the diff. The full diff is written to the data folder (diffs/).

mod_impactB

Which cached mods and drafts reference what changed between two snapshots: removed/renamed unit type ids (unitType[id]), changed build rules (build[i]), researches/upgrades ([i]), removed or changed API functions and fields. Returns file:line with the code line and the reason.

log_tailA

Follow gen/log.txt: returns lines written since cursor and next_cursor for the next call. Without a cursor returns the last initial_lines lines. Detects the log being recreated at game start (rotated=true) and first returns the unread rest of the old session from log_prev.txt.

watch_log_startA

Start a background watcher on gen/log.txt (from the current end, or from_start=true). It parses Lua run/compile errors and engine warnings, maps them to the draft or cached mod source (explicit /modsStorage path or [string "..."] chunk preview) with a code excerpt, and survives log recreation at game start. Read events with watch_log_poll.

watch_log_pollA

New watcher events after since_seq (use next_seq from the previous call). Each event: seq, kind (lua_error, compile_error, warning, engine_error), time, script, message, frames, source (mod, draft/cache, file, line, excerpt).

watch_log_stopA

Stop the background log watcher. Collected events stay available to watch_log_poll.

write_draftA

WRITE: overwrite the existing draft modsStorage/draft/_-.lua of a mod (latest draft version by default). The game creates that file when the mod script is opened with 'edit script' in developer mode; this tool never creates files and never touches published files in modsStorage. The previous content is backed up to the user data folder (draft-backups). Save/apply in the game.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

B3.4/5.0

Scored across 26 tools

Disambiguation4/5

Most tools target clearly distinct actions and resources, but the several log-related tools (read_log, log_tail, log_errors, watch_log_poll) and some search tools (search_mod_code vs find_examples) risk misselection. Descriptions largely clarify the boundaries, but minor overlap remains.

Naming Consistency3/5

Snake_case is used throughout, but the naming pattern is inconsistent: many are verb_noun (search_mod_code, read_log, list_mods) while others are noun_noun (game_data_query, log_errors, api_index_status, mod_impact). The names are readable but do not follow a single predictable convention.

Tool Count2/5

At 26 tools, the set exceeds the 25-tool threshold for 'too many' and includes several closely related log-watching and diagnostics tools that could be consolidated. The broad modding domain justifies many tools, but the count is heavy for an MCP server.

Completeness4/5

The tool surface covers searching, linting, diffing, log analysis, API indexing, unit lookup, and draft writing, with few obvious gaps for the core modding workflow. Missing a way to create or delete published mods and some write operations are limited to drafts, but agents can work around these limitations.

Maintenance

ActivityMaintained
ResponsivenessNo issues