gmod-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
The game is not running right now: start it with -mcp; the tools come back by themselves.
gmod-mcp drives a LOCAL Garry's Mod instance (mode client, instance 'none yet: the game is not running').
Feedback: while you work, note frictions with gmod-mcp itself (a wrong description, an error without a reason, a missing tool, a workaround). At the end of your task, only if one cost real time or came back, offer the user in one line to report it to the maintainers (you do everything). The issue is PUBLIC: no secrets, personal paths, project or addon names, or project code. Procedure: guide "Reporting frictions" (https://github.com/ExtReMLapin/gmod-mcp). The user can turn these offers off (plugin option feedback_offers: /plugin configure gmod-mcp@gmod-mcp, then restart Claude Code): say so in your offer.
Realms: 'menu' (client mode, always there), 'client' and 'server' (once a map is loaded, recreated on every map change); srcds has only 'server'. Order: status -> map_load -> lua_exec / ents_find / trace / screenshot... -> errors_since.
Pitfalls: (1) realm_unavailable: load a map (srcds: use realm 'server'; client-side tools answer 'unsupported'); client_locked: no client realm while connected to a non-loopback server. (2) Effects take a frame: use wait_for / wait_frames, not guesses. (3) map_load run as a background task: wait for its result before any realm tool (an earlier call reaches the OLD map; results carry generation). (4) Every instance shares the game folder with the user's own game (archived convars, data/, cookies): restore what a test changes. (5) A frozen game: status reports it, game_terminate ends it. More: guide "Pitfalls the instructions used to list".
Lua files: working directory = /garrysmod/lua/mcpagent_tmp (lua/mcpagent_tmp/): if you share this disk write there, then lua_exec_file(realm, 'name.lua'); else lua_file_write.
Long Lua work (scans, timed tests): never loop inside lua_exec (the game freezes): use lua_job (job:step() in loops, job:progress, return the result); prompt write-lua-job.
Docs: api_search (what exists in each realm), wiki_search / wiki_page. Full guide: resource mcpagent://guide.
Code Mode (calling these tools from a script): a call returns a JSON string, so JSON.parse it (accept an object too); an error throws, e.detail.error.code / e.detail.error.message say why (guide section "Code Mode").
Multi-instance: instances_list; every tool accepts 'instance'. client_crashed / server_crashed = that game crashed (details.dump is for a human): relaunch and rerun; instance_hung = frozen: close it and relaunch; instances_launch refuses with low_memory when the machine is full.
Launches and map loads (engine bug FP7137: a starting game makes the others release their GPU resources for 2-10 s, and a map load ending then crashes them): the bridge makes instances_launch and map_load wait for each other (waited_s; errors map_load_in_progress / launch_in_progress: retry). Launch all clients in one call; start no game and change no map by hand meanwhile; other games can be unreachable for 15-18 s after a start. Guide "Launches and map loads".
Testing an addon branch: lua_mount {path: } (or instances_launch {lua_mount}), effective at the next map_load. Guide "Mounted Lua folder".
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tasks | {
"list": {},
"cancel": {},
"requests": {
"tools": {
"call": {}
}
}
} |
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
| resources | {
"subscribe": false,
"listChanged": true
} |
| completions | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| statusA | status(timeout_s?, fields?). Instance status: call it first (it works even if the game is frozen). Summary fields at the top (instance, mode, version, map, gamemode, maxplayers, fps, fps_max (the frame cap: 20 on a light test client), loading, uptime, main_thread_stalled, tmp_dir) and one object per realm (menu, server, client). With a mounted Lua folder |
| lua_execA | lua_exec(code, realm?, timeout_s?, budget?, chunkname?, depth?, fields?, hook_guard?, limit?, ...). Runs Lua code in a realm under xpcall + debug.traceback at full speed (no time limit unless |
| lua_exec_fileA | lua_exec_file(path, realm?, timeout_s?, assign_to?, budget?, chunkname?, depth?, fields?, hook_guard?, ...). Like lua_exec but runs a file from the game's disk (relative: the mounted Lua folder first, see lua_mount): saves the file's tokens on every call; the chunk is named after the real path. Result as lua_exec plus file, from_mount (true: the lua_mount copy), other_matches (other files it fits: they did NOT run), compile_ms. A data file outside lua/ (file.Read cannot reach it): absolute path + assign_to, e.g. {"path": "D:/dev/my-addon-wt/tests/fixtures/walls.lua", "assign_to": "WALLS"}. include() of a file outside lua/ loads nothing: use this tool. Its hooks are registered unwrapped, as the game would (hook_list: added_by "lua_exec_file"), unless hook_guard is above 0. With |
| lua_reloadA | lua_reload(path?, timeout_s?, budget?, chunkname?, depth?, fields?, limit?, max_string?, ...). Runs an edited addon or gamemode file again from disk, in every realm it belongs to (mounted folder, lua/, gamemodes/, addons in the engine's order), to test an edit without reloading the map. Result per realm: a lua_exec result or {error}, with file, from_mount, other_matches (they did NOT run, the first match wins), compile_ms, note?. Pitfalls (the |
| lua_checkA | lua_check(realm?, code?, path?, globals?, limit?). Compiles Lua with the game's own parser (GLua: !=, &&, continue, /* */) and runs nothing. |
| lua_inspectA | lua_inspect(expr, realm?, depth?, limit?). Evaluates an expression in a realm (it runs: keep it side-effect free; 2 s limit) and describes the value: type, value (to |
| lua_function_sourceA | lua_function_source(expr, realm?). Tells where a function was defined and whether the game runs the current code of that file (its bytecode is compared with the file compiled again from disk, in the same realm; mounted folder first). Use it before trusting a test result after an edit. Result: source, linedefined, file/disk (the copy this realm ran), from_mount, provenance, matches_disk: true (same code) | false (edited since it loaded, or another copy) | null (no file: lua_exec/RunString code, or inside a .gma), line_on_disk, note. |
| lua_file_writeA | lua_file_write(name, content). Writes (or overwrites) a file in lua/mcpagent_tmp/, creating subfolders (when you do not share the game's disk; if you do, write there directly). Run it with lua_exec_file {path: name}. Result: {path, bytes, exec_path}. |
| lua_file_readA | lua_file_read(name). Reads a file of the game's lua/mcpagent_tmp/ folder. Result: {path, content}. Error not_found. |
| lua_file_listA | lua_file_list(). Lists every file under the game's lua/mcpagent_tmp/ folder, subfolders included. Result: {dir (absolute), files: [paths relative to dir, sorted]}. |
| lua_file_deleteA | lua_file_delete(name). Deletes one file of the game's lua/mcpagent_tmp/ folder (code it defined keeps running). Result: {deleted}. Error not_found. |
| map_listA | map_list(filter?, limit?). Installed maps: every maps/*.bsp on the game's GAME path (garrysmod, addons, workshop, mounted games), names without .bsp, sorted, filtered by a case-insensitive substring. The same on every instance of this game folder (no |
| map_loadA | map_load(map, timeout_s?, gamemode?, maxplayers?, then?). Loads a map and WAITS until it is playable (client mode: console |
| disconnectA | disconnect(timeout_s?). Leaves the current map for the main menu (console |
| game_quitA | game_quit(). Asks the game to quit cleanly (console |
| game_terminateA | game_terminate(delay_ms?). Kills this game process at once (no config saved) from the network thread, so it works even when the game is frozen (status main_thread_stalled). The answer {terminating, pid} is sent first, then the process ends after delay_ms. With |
| wait_forA | wait_for(condition, realm?, timeout_s?, interval_s?). Waits until a Lua condition is true. |
| wait_framesA | wait_frames(n, timeout_s?). Waits until the game's main loop has run n more frames, e.g. to let a console command, a spawn or a SetPos take effect. Result: {frames, elapsed_s}. Error timeout if fewer frames render in timeout_s (frozen, or minimized with a low fps_max_nofocus). A light test client runs at 20 fps: 20 frames = 1 s. |
| console_execA | console_exec(cmd, realm?, connect_timeout_s?, regex?, wait_frames?). Runs a console command line from a realm (menu: RunConsoleCommand; server: game.ConsoleCommand; client: RunConsoleCommand, falling back to the engine if Lua blocks it). ';' and line breaks outside quotes separate commands. Waits a few frames, then returns the console lines printed meanwhile (the console is shared: filter with |
| console_waitA | console_wait(regex, timeout_s?, count?, cursor?). Blocks until |
| console_readA | console_read(cursor?, limit?, regex?). Reads this game's console output: everything the engine and Lua print in every realm, one entry per line, in a ring buffer (20000 lines by default, see console_buffer) that survives map changes. Without |
| console_bufferA | console_buffer(capacity?). Reads or sets how many console lines this game keeps for console_read, console_wait and console_exec (default 20000; lowering it drops the oldest lines at once). Without |
| errors_sinceA | errors_since(realm?, cursor?, exclude_pattern?, exclude_source?, group_by?, limit?, pattern?, since_map_load?, ...). Lua errors of every realm of this game (client mode: the menu's OnLuaError hook; srcds: parsed from the console); the last 2000 are kept and survive map loads. Cursor: 0 = from the oldest; pass next_cursor to read only new ones (lua_exec, lua_job, tests_run, map_load... already carry new_errors with such a cursor). Grouped by default (a stuck loop repeats one error thousands of times): {groups: [{message, source, count, first_time, last_time, stack}], groups_total, next_cursor, lost}, most frequent first, 20 groups unless |
| errors_clearA | errors_clear(). Forgets the errors kept so far (errors_since then starts empty); cursors keep growing, so an old cursor stays valid. Result: {cleared, next_cursor}. |
| convar_getA | convar_get(name, realm?). Reads a convar: value (string), number (compare this: the same value can read "0.0" or "0.000000"), default, help, flags, min/max, and archived: true when changing it is saved into cfg/config.cfg (shared with the user's game and every instance; archived_from says flags or config.cfg). Do not use ConVar:IsFlagSet(FCVAR_ARCHIVE) from Lua for this: it can be false for an archived convar (CreateClientConVar with save). A convar created this session and not saved yet shows archived: false. FCVAR_PROTECTED convars have their value masked. |
| convar_setA | convar_set(name, value, realm?, persist?). Sets a convar from a realm (RunConsoleCommand; server: game.ConsoleCommand), waits 3 frames and reads it back; when Lua cannot set it (volume_sfx...) it retries through the engine console. FCVAR_ARCHIVE convars are saved into the user's cfg/config.cfg when the game quits and shared by every game of this folder: refused unless persist: true. Result: the convar as convar_get reads it, plus previous and via. Errors: not_found, protected, archived, set_refused (cheat without sv_cheats, wrong realm, blocked command). |
| concommand_listA | concommand_list(realm?, engine?, filter?). Lists console commands: the Lua commands of |
| ents_findA | ents_find(realm?, class?, limit?, model?, near?, radius?). Lists entities, filtered by class, model and/or distance (filters combine; none = every entity). class and model are case-insensitive globs ("prop_*", "door"). near + radius keep entities within radius of near, nearest first, each with |
| ent_infoA | ent_info(id, realm?, depth?, limit?). Details of one entity by index (id 0 = the world): class, model, name, nick, pos, ang, valid, velocity, health, solid, movetype, obb, parent and owner (ids or null), nw_vars, table (the entity's Lua table, cut at depth/limit), and in the server realm keyvalues and, for doors, door {state: closed|opening|open|closing|ajar}. |
| ent_spawnA | ent_spawn(class, ang?, freeze?, keyvalues?, model?, pos?). Creates an entity in the server realm: ents.Create(class), SetModel, SetPos, SetAngles, SetKeyValue for each keyvalue (strings), Spawn, Activate, then freeze. It stays until removed or the map changes. Result: the entity summary {id, class, model, name, pos, ang}. Error invalid_class. Needs a loaded map (map_load): the server and client realms do not exist at the main menu. |
| ent_removeA | ent_remove(id). Removes an entity by index in the server realm (Entity:Remove, effective at once). Players and the world are refused (forbidden); an invalid id gives not_found. Result: {removed: id}. Needs a loaded map (map_load): the server and client realms do not exist at the main menu. |
| ent_fireA | ent_fire(id, input, delay?, param?). Sends a map I/O input to an entity in the server realm (Entity:Fire(input, param, delay)), e.g. Open, Close, Toggle, Lock, Kill. Returns at once: the effect happens on a later frame, so check it with ent_info or wait_for. An input the entity does not know is ignored silently (no error). Needs a loaded map (map_load): the server and client realms do not exist at the main menu. |
| players_listA | players_list(realm?). Every player (bots included). Result: {players: [{id (entity index, for player_set), class, model, nick, pos, ang, userid, steamid, bot, alive, health, eye_pos, eye_ang, noclip, god (server realm only)}], count, maxplayers}. Needs a loaded map (map_load): the server and client realms do not exist at the main menu. |
| player_setA | player_set(ang?, god?, id?, noclip?, pos?). Changes a player in the server realm: pos teleports it, ang sets its eye angles, noclip switches noclip/walk, god toggles god mode. Only the given fields change. Default player: the first one. Result: {id, nick, pos, ang, eye_ang, noclip, god} read right after; the client sees it on a later frame. Needs a loaded map (map_load): the server and client realms do not exist at the main menu. |
| bots_addA | bots_add(n, name?). Adds n bots in the server realm (player.CreateNextBot), named _. They need free player slots: singleplayer (maxplayers 1) has none (error no_slots): map_load with maxplayers: 4 first. Bots do not survive a map load. Needs a loaded map (map_load): the server and client realms do not exist at the main menu. |
| traceA | trace(start, end, realm?, filter?, mask?). One util.TraceLine from start to end. Result: hit, hit_world, hit_sky, pos (hit position, or end), normal, fraction (0..1), distance, mat_name, surfaceprop, texture, entity (summary, {id: 0, class: worldspawn} for the world, or null), start_solid, all_solid, hitgroup. For everything a segment crosses (walls, doors, thickness), use trace_through. Needs a loaded map (map_load): the server and client realms do not exist at the main menu. |
| trace_throughA | trace_through(start, end, realm?, filter?, mask?, max_surfaces?). Lists every solid the segment start->end goes through, in order, by repeated traces. Result: {surfaces: [{entry, entry_surface, distance_from_start, exit, exit_surface, thickness}], count, total_thickness, distance, truncated}. A start point inside a solid gives a first entry with entry_surface null. Made for sound propagation through walls and doors. Needs a loaded map (map_load): the server and client realms do not exist at the main menu. |
| screenshotA | screenshot(crop?, format?, full?, h?, quality?, scale?, scale_filter?, source?, ...). Client only (unsupported on srcds). Captures what the game shows and returns an MCP image plus {source, format, w, h, method, bytes}. Default: shrunk to at most 960 px wide, JPEG quality 80 (result downscaled_from); |
| screenshot_fromA | screenshot_from(pos, ang, format?, fov?, full?, h?, quality?, w?, wait_frames?). Captures the scene from an arbitrary camera (pos, ang, fov) as an MCP image; the player does not move. Client only (unsupported on srcds), with a loaded map. Without w/h a temporary CalcView hook moves the view for 3 frames (shrunk to 960 px like screenshot; full: true for the full size); with w/h it renders off-screen at that size. The local player's body is drawn; debug_draw primitives are visible. |
| debug_drawA | debug_draw(primitives, duration?). Client only (unsupported on srcds). Draws 3D lines, arrows, wireframe boxes and spheres, and text in the game world (a map must be loaded), visible on screen and in screenshot / screenshot_from. They add up across calls and expire after |
| debug_clearA | debug_clear(). Client only (unsupported on srcds). Removes every primitive drawn by debug_draw (client realm). Result: {cleared: count}. |
| sound_emitA | sound_emit(name, realm?, dsp?, ent?, level?, pitch?, pos?, volume?). Plays a sound once, from a position (EmitSound) or from an entity (Entity:EmitSound, it follows the entity). Pass pos or ent. |
| sound_traceA | sound_trace(realm?, duration_s?, max_calls?). Records the sounds the game emits through the EntityEmitSound hook during duration_s (or until max_calls), then removes its recorder (behaviour unchanged). Waits the whole duration (can run as an MCP task). Result: {event, calls: [{t, sound: {name, level, pitch, volume, dsp, channel, pos, entity}}], recorded, total_calls, capped}. Not seen: surface.PlaySound (UI sounds), and sounds a hook running before the recorder suppressed. Needs a loaded map (map_load): the server and client realms do not exist at the main menu. |
| perf_snapshotA | perf_snapshot(). Quick performance numbers of this game process. Result: {frame: {fps, frametime_avg_ms, frametime_max_ms} over the last 256 frames, last_tick_age_s (large = frozen), realms: {menu|client|server: {lua_memory_kb, entity_count, frametime}}}. Mind the frame cap (status fps_max: 20 on a light test client). Per-hook costs: perf_hook_cost. |
| ui_clickA | ui_click(x, y, allow_user_game?, button?, coords?, double?, screenshot_after?, screenshot_size?, wait_frames?, wheel?). Clicks (or scrolls the wheel) at a point of the game window: for what has no console command (VGUI2 dialogs such as "Disconnected by the server" > Close, Derma panels, the menu's HTML). Coordinates come from a |
| ui_keyA | ui_key(allow_lossy?, allow_user_game?, key?, screenshot_after?, text?, wait_frames?). Presses a key and/or types text into the focused part of the game UI (a dialog's text entry, a Derma TextEntry, an HTML input). key: a named key (enter, escape, tab, backspace, space, arrows, home, end, pageup, pagedown, insert, delete, f1..f12) or a letter / digit (typed as a character, like |
| api_searchA | api_search(pattern, realm?, limit?). Asks each running realm which functions really exist in this game build: globals, library functions (util.TraceLine) and metatable methods (Entity:EmitSound). Menu always answers (client mode); client and server only with a map loaded. The source of truth when the wiki disagrees. Pattern: a case-insensitive substring, or a glob with * matched against the whole name. Result: {results: [{name, kind, realms, wiki_page}], count, realms_searched}. |
| wiki_searchA | wiki_search(query, limit?, refresh?). Finds pages of the official wiki (https://wiki.facepunch.com/gmod/) by NAME, not by content: exact, then prefix, substring and approximate matches, best first (Entity:EmitSound, util.TraceLine, GM:PlayerSpawn, Global.EmitSound). The page list is downloaded once and cached 24 h. Result: {query, results: [{page, score, url}], total_matches}. Then read one with wiki_page. |
| wiki_pageA | wiki_page(name, format?, refresh?). Reads one wiki page by its exact name (as wiki_search returns it): format text = the raw wiki markup, json = the wiki's JSON form. Cached 7 days (refresh: true re-downloads). Result: {name, format, url, cache, content | page}. A name that is not a page is looked up: CurTime reads Global.CurTime (resolved_from says so) when only one page can mean it, otherwise not_found lists the close pages in details.candidates. |
| events_waitA | events_wait(timeout_s?, cursor?, limit?, types?). Waits for events of this game instance and returns AS SOON AS one of the wanted types arrives (all that arrived, up to limit), or after timeout_s with timed_out: true. Types: menu_ready, runtime_injected, realm_up, realm_down, realm_ready, map_loaded, disconnected, disconnect_reason, connection_failed, main_thread_stalled, main_thread_resumed, lua_error, runtime_error, report, focus_released, user: (from game code: mcpagent.event(type, data)). Without |
| reports_readA | reports_read(channel, cursor?, limit?, wait_s?). Reads the values that game code published with mcpagent.report(channel, value) (a Lua function gmod-mcp adds in every realm; job:report(value) of a lua_job publishes on "job:"), whole, as JSON. Read incrementally: cursor 0 = the oldest kept value, then pass next_cursor; wait_s > 0 waits until a new value arrives. Each channel keeps its last 10000 values; channels survive map changes until reports_clear. Result: {channel, items: [{seq, time, realm, value}], next_cursor, lost, timed_out}. |
| reports_channelsB | reports_channels(). Report channels of this instance: {channels: [{channel, buffered (values kept), total (ever published), next_cursor}]}. |
| reports_clearA | reports_clear(channel?). Deletes a report channel and its values (all channels if |
| hook_listA | hook_list(realm?, name?, added_by?, event?). Hooks registered with hook.Add in a realm (hook.GetTable), with where each function was defined. Without |
| hook_traceA | hook_trace(event, realm?, depth?, duration_s?, max_calls?). Records the calls of a hook event for duration_s (or until max_calls) with each call's arguments serialized, through a temporary hook.Add that returns nothing (behaviour unchanged), removed at the end. Waits the whole duration (can run as an MCP task). Result: {event, calls: [{t, args}], recorded, total_calls, capped, duration_s}. Not seen: calls that a hook running before it stopped by returning a value. Error realm_lost if the map changes meanwhile. |
| perf_hook_costA | perf_hook_cost(event, realm?, duration_s?). Measures over duration_s the time spent in each function of a hook event (every hook.Add function registered when it starts, and GAMEMODE:), each wrapped with a timer and put back afterwards. Waits the whole duration. Result: {event, duration_s, functions: [{id, calls, total_ms, avg_ms, max_ms, src}] most expensive first, restored}. The game runs at its real frame rate (a 20 fps test client makes fewer calls). |
| tests_runA | tests_run(path, realm?, timeout_s?, budget?, case?, detail?, exclude?, fields?, frames_between_files?, ...). Runs test files in GLuaTest format in one realm. A file returns {groupName, beforeAll, beforeEach, afterEach, afterAll, cases = {{name, func, skip?, when?, timeout?, timing?}}}; inside, expect(x).to.equal(y) etc. (format and assertions: resource mcpagent://tests-format). |
| lua_jobA | lua_job(realm?, code?, path?, timeout_s?, args?, async?, chunkname?, depth?, ...). Runs a Lua script as a coroutine resumed once per frame, for long work (scans, batches of traces, multi-second tests): never loop inside lua_exec. The script must cooperate through the |
| lua_job_statusA | lua_job_status(fields?, id?, since?, wait_s?). State of a job started by lua_job (frames, elapsed_s, progress) plus only the reports added since your previous call: reports, reports_from (index of the first), reports_total, reports_already_delivered; |
| lua_job_cancelA | lua_job_cancel(id). Asks a running job (lua_job, e.g. async: true) to stop at its next frame. Result: {job_id, cancelled (false if the id is unknown), note}; its final state (cancelled) stays readable once with lua_job_status. |
| instances_listA | instances_list(include_crashed?, owner?). Known gmod-mcp instances (this one and, on the coordinator, every registered member): id, mode (client/srcds), port, pid, map, realms, role, state, fps, stalled_s, loading, lua_errors. Any tool accepts |
| lua_mountA | lua_mount(path?, allow_shadow?, empty_cache?). Plugs a folder (e.g. the git worktree of an addon: the folder that contains lua/) into THIS game process only: every Lua lookup of this game then looks there first (autorun, include(), AddCSLuaFile, file.Read/Find "LUA", lua_exec_file, lua_job {path}, lua_check, lua_reload). A file in the folder hides the installed addon's file of the same Lua path. Only Lua (not materials, sounds, data/): a data file outside lua/ loads with lua_exec_file {path: absolute, assign_to: "NAME"}. IT TAKES EFFECT AT THE NEXT MAP LOAD: call map_load right after. No autorefresh: status.lua_mount.stale_files lists the changed files; lua_reload {mounted_changed: true} runs them again. |
| instances_launchA | instances_launch(timeout_s?, allow_shadow?, commands?, count?, desktop?, early_lua?, fps_max?, fps_max_nofocus?, ...). Starts 1 to 8 test clients of Garry's Mod (also when no game runs: the first becomes the main instance), each with -multirun, gmod-mcp on, a small window and a frame cap, on a private Windows desktop, then loads |
| instances_closeA | instances_close(all?, instances?, owner?, pids?). Closes test clients this session started with instances_launch, at once, without writing their config: by |
| instance_selectA | instance_select(instance). Makes |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| write-lua-job | Write and run a lua_job script for a long task (scan, batch of traces, timed test) with progress reporting. |
| debug-errors | Collect the recent Lua errors, find their root cause in the code and propose (or apply) a fix. |
| run-tests | Run a GLuaTest-format test file, then analyze the failures. |
| check-map | Load a map, then report errors, entity counts, performance and a screenshot. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| guide | Realms, workflow, temporary files, return formats, error codes. |
| tests-format | GLuaTest format accepted by tests_run and list of assertions. |
| config | Absolute paths (game, Lua temporary directory, data), mode, port, instance identifier. |
| errors | Last 100 Lua errors of every realm (JSON). Subscribable: updated when a new error is captured. |
| console | Last 200 console lines. Subscribable: updated when new lines are printed. |
TDQS
Scored across 65 tools
Given 65 tools, the boundaries are remarkably well-drawn: lua_exec/lua_exec_file/lua_reload/lua_job, console_exec/console_read/console_wait, and ent_* each have a distinct role spelled out in the descriptions. The few soft spots are the stop/leave trio (disconnect vs game_quit vs game_terminate), the overview trio (status vs perf_snapshot vs instances_list), and the trace vs trace_through pair, all of which still read distinctly once the descriptions are consulted.
A consistent domain-prefix + verb_noun scheme dominates (map_load, ent_spawn, console_read, reports_clear, instances_launch, hook_trace), making the whole set scannable. Minor deviations exist: bare nouns like status, trace, screenshot, disconnect, and the singular/plural split between ents_find and ent_info/ent_spawn/ent_remove.
65 tools is far past the practical ceiling for an agent to navigate comfortably, and some obvious clusters (lua_file_read/write/list/delete, the four console_* tools, the three reports_* tools) could reasonably be consolidated. The breadth of the domain (Lua execution, entities, console, maps, instances, screenshots, sounds, hooks, tests, wiki) justifies a large surface, but not this large.
The surface covers the whole debugging/testing lifecycle: instance launch/close/select, map load/list, Lua exec/exec_file/reload/check/inspect/job, entity CRUD plus I/O, players/bots, console and convars, traces, screenshots, debug draw, sounds, hooks, errors, reports, and even tests_run and wiki lookup. There are almost no dead ends for an agent working inside a Garry's Mod session.