Skip to main content
Glama

Quit the game cleanly

game_quit
Destructive

Quits a Garry's Mod instance cleanly: it saves config and video settings, then exits, which also stops that instance's MCP server. Use instances_close for test clients launched by instances_launch.

Instructions

Asks the game to quit cleanly (console quit): it saves its config (cfg/config.cfg, video settings) and exits; the MCP server of this instance goes away with it. For test clients started by instances_launch, prefer instances_close (it kills the process: nothing is saved, and the exit is short); game_quit is safe on them too: before quitting, the module gives the archived convars their command line changed (fps_max, fps_max_nofocus, snd_mute_losefocus, and those named by instances_launch commands or launch_args) the user's values from cfg/config.cfg, or their defaults when the file has no line. On a dedicated server the console quit is blocked from server Lua: on Linux the module then ends the process itself with SIGTERM (the server's own clean shutdown, half a second after the answer); where that is not possible (Windows srcds) the error is blocked and nothing quits. Result: {quitting: true}; on the coordinator while other instances live, also coordinator_moved: true, remaining_instances and a warning (they elect a new coordinator).

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": "game_quit"
  }
}

Input Schema

NameRequiredDescriptionDefault
instanceNoOptional. Instance identifier (see instances_list). If present and different from the local instance, the call is relayed by the coordinator to that instance.

Output Schema

NameRequiredDescriptionDefault
nextNo
noteNo
warningNo
quittingYes
next_callNo
answered_byNo
truncated_noteNo
version_warningNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.7

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes far beyond the destructiveHint annotation: it discloses that cfg/config.cfg and video settings are saved, that command-line convars are restored to user values or defaults, that the MCP server disappears, and the platform-specific fallback (SIGTERM on Linux, `blocked` on Windows srcds). Coordinator migration side effects are also described.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose and alternative tool recommendation, then progressively deeper caveats. It is dense and long, but each clause carries operational meaning; minor densification could improve readability without losing content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Complete for a destructive lifecycle tool: it covers what is saved, what changes are reverted, platform failure modes, coordinator behavior, and the result shape (including output schema existence). An agent has enough to decide when and how to call it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the optional `instance` parameter and its relay behavior are already documented in the schema. The description adds no parameter-specific detail, which is acceptable given the schema's completeness.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Asks the game to quit cleanly') and immediately ties it to the console `quit` mechanism plus config-saving semantics. It distinguishes itself from instances_close and, by implication, from harder termination siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says to 'prefer instances_close' for test clients started by instances_launch, and explains why (kills the process, nothing saved, short exit), while noting game_quit is still safe there. The conditions that select one tool over another are spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.