Skip to main content
Glama

Take a screenshot

screenshot
Read-only

Captures what the game displays and returns it as an MCP image, using render capture with a map or engine JPEG for menus and dialogs.

Instructions

Client only (unsupported on srcds). Captures what the game shows and returns it as an MCP image (plus {source, format, w, h, screen_w, screen_h, method, bytes}). Two sources, chosen by source (auto by default). render: what the local player sees, drawn by the engine; needs a loaded map (client realm); without w/h it is the game window as it is, HUD included (method backbuffer), with w/h the player's view rendered again at that size, without HUD or view model (method render_target); debug_draw primitives are visible; a minimized or frozen game gives timeout after 10 s. engine_jpeg: the engine's own jpeg console command, the only way to see the main menu, a VGUI2 dialog ("Disconnected by the server") or a loading screen, when there is no client realm. It is the engine's own capture, so it works while other windows cover the game, takes no focus and does not touch the window. The engine writes the picture to garrysmod/screenshots/.jpg and prints the name in its console; the module reads exactly that file and deletes it (and nothing else; result file, file_deleted, and a warning with the path if the file could not be deleted). The image is the game's screen size (the space ui_click coordinates are read on) as a JPEG at the engine's own quality (convar jpeg_quality, not changed): format, w, h and quality are not applied and, when given, are listed in ignored. A picture the user takes with their own jpeg command in the same instant can be mistaken for it. One capture at a time. Errors: realm_unavailable (source render without a map), unsupported (srcds), client_locked, capture_timeout (no Wrote line from the engine within 4 s: game minimized or frozen, or the console capture is off), capture_failed (the file named by the engine could not be taken; it is left in place and named). Example: {"w": 1280, "h": 720, "format": "png"} with a map, or {"source": "engine_jpeg"} at the main menu.

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

Input Schema

NameRequiredDescriptionDefault
hNoHeight in pixels (default: the game window's).
wNoWidth in pixels (default: the game window's).
formatNoDefault jpeg.
sourceNoauto (default): the render capture when a map is loaded, the engine's jpeg command otherwise. render: the engine's render capture (client realm only). engine_jpeg: the engine's own `jpeg` console command, with or without a map (format, w, h and quality do not apply to it).
qualityNoJPEG quality (default 90).
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
hNo
wNo
fileNo
nextNo
noteNo
bytesYes
formatNo
methodNo
sourceNo
ignoredNo
warningNo
screen_hNo
screen_wNo
next_callNo
capture_msNo
answered_byNo
file_deletedNo
truncated_noteNo
camera_restoredNo
version_warningNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.7

TDQS

A4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint, so the description carries the burden and mostly delivers: it discloses the side effect of writing and deleting garrysmod/screenshots/<name>.jpg, warns of collision with a user's own jpeg command, states serialization ('One capture at a time'), and enumerates error codes with causes (realm_unavailable, unsupported, client_locked, capture_timeout at 4 s / 10 s timeout, capture_failed with the file left in place). Minor inconsistency: a 'timeout after 10 s' for render versus 'within 4 s' for the engine path is stated without reconciling which deadline applies, which slightly muddies the failure model.

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

Conciseness3/5

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

Front-loaded with the scope constraint and source choice, which is good, but the middle is a dense single block covering methods, HUD behavior, file lifecycle, convar interactions, race conditions, and errors without paragraph breaks or list structure. Nearly every clause carries information, yet the wall-of-text form makes the critical routing rule (which source when) harder to extract than it needs to be.

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

Completeness4/5

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

An output schema exists and the description still summarizes the return payload ({source, format, w, h, screen_w, screen_h, method, bytes}), so return values are covered. For a tool with six optional parameters, two enums, and nontrivial lifecycle side effects, the definition is close to complete; the main gaps are the unresolved timeout discrepancy and no guidance on the `instance` relay parameter.

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 description coverage is 100%, so the baseline is 3. The description nevertheless adds real meaning the schema does not: that w/h trigger a different method (render_target at that size, no HUD or view model) versus the window-sized backbuffer capture with HUD and debug_draw primitives. It also clarifies that format, w, h and quality are not applied for engine_jpeg and are reported in `ignored`, but it never explains `instance` and only glancingly ties `quality` to the jpeg_quality convar.

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 ('Captures what the game shows and returns it as an MCP image') and immediately differentiates the two capture sources by name, with `source` semantics spelled out. The opening 'Client only (unsupported on srcds)' bounds the tool up front, which is more than a generic screenshot description would.

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

Usage Guidelines4/5

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

Gives concrete when-to-use selection rules: render for the loaded-map client realm, engine_jpeg only for the main menu, VGUI2 dialogs like 'Disconnected by the server', or loading screens. Includes two runnable examples ('{"w": 1280, "h": 720}' with a map, '{"source": "engine_jpeg"}' at the main menu) that map conditions to invocations. It does not name a sibling alternative for other screenshot needs (e.g. screenshot_from), so it stops short of explicit alternatives.

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