Skip to main content
Glama

tool_capture_window

Capture a window screenshot and SAVE IT TO A FILE. Provide hwnd or title substring. Crops to the window's CLIENT area by default, so image pixel (0,0) is the same point click_at calls (0,0) — no frame offset to guess.

Instructions

Capture a window screenshot and SAVE IT TO A FILE. Provide hwnd or title substring. Crops to the window's CLIENT area by default, so image pixel (0,0) is the same point click_at calls (0,0) — no frame offset to guess. Returns bounds = the screen rect (x,y,width,height) the image maps to, and per-axis scale_x and scale_y. Multiply image coordinates by the corresponding scale and then add the bounds origin to get screen coordinates. A DPI-virtualized target can have different image-pixel and screen-pixel dimensions even without resizing. Also reports dpi_verified; when false, image pixels and input coordinates cannot be safely paired. Defaults to JPEG q80 — a 1080p shot is ~6-10x smaller than PNG, which is what keeps a long session's request body under the provider's 32 MiB cap. The bytes are NOT inlined as base64 by default (that costs ~12,500 tokens per shot as text); read the saved_path with read_image instead, which attaches the same picture for ~50 tokens. Pass include_data_uri=true only when a caller genuinely cannot read a file. Read-only — no input injection, no focus change.

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

Input Schema

NameRequiredDescriptionDefault
hwndNo
titleNo
max_dimNo
qualityNo
save_pathNo
client_onlyNo
image_formatNojpeg
include_data_uriNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden and does well: it declares read-only behavior ('no input injection, no focus change'), explains the client-area cropping invariant, the DPI-virtualization trap, and the dpi_verified safety flag. It omits failure behavior — what happens if hwnd is stale or a title substring matches several windows — which matters for an 8-param tool with zero annotation coverage.

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 verb and resource, then the coordinate-mapping math, then the size/format rationale. It is dense and nearly every sentence carries decision-relevant information, though the token-cost figures (~12,500 vs ~50 tokens) are more persuasion than specification.

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?

Covers the hard parts of a coordinate-returning screenshot tool — bounds, scale_x/scale_y, dpi_verified, and cross-referencing click_at. An output schema exists so return-shape explanation was optional, yet the missing max_dim semantics and undefined not-found/ambiguous-window behavior leave small gaps for an 8-param tool.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate and largely does: it explains hwnd/title selection, client_only cropping, quality and image_format defaults (JPEG q80 with size rationale), include_data_uri, and save_path consumption via read_image. max_dim is never mentioned, leaving one parameter with no explanation anywhere.

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 plus a critical behavioral distinction: 'Capture a window screenshot and SAVE IT TO A FILE' and 'The bytes are NOT inlined as base64 by default.' That single sentence separates this tool from any inline-image sibling an agent might otherwise pick.

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 selection rules — pass hwnd or title substring, and prefer read_image on saved_path over include_data_uri 'only when a caller genuinely cannot read a file.' It stops short of naming a sibling screenshot tool for comparison, but the conditions for each mode are explicit.

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