Skip to main content
Glama

capture_window

Read-onlyIdempotent

Screenshot a single desktop app window by its list_windows ID without moving, resizing, or focusing it, and save the PNG for annotation.

Instructions

Screenshot one window by id (from list_windows); never moves, resizes or focuses it. On macOS other windows covering it do not show; on Windows and Linux they may, since the fallback grabs the window's screen area. Use it for desktop apps; capture_screen for several windows, capture_web for web pages. macOS only: targets {name: {"element": label, "role"?, "nth"?, "exact"?}} measures buttons and fields through Accessibility (needs that permission) and returns their rects plus the scale for the annotate spec. Needs Screen Recording on macOS. Writes a PNG to the temp folder. Returns its path, size, window_id, rects and scale when targets were given, and a preview.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesWindow id from list_windows.
targetsNomacOS only. Named controls to measure: {"name": {"element": "label", "role"?: "button", "nth"?: 0, "exact"?: true}}.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • addedInput schema / properties / id / description
      Added value: +"Window id from list_windows."
    • addedInput schema / properties / targets / description
      Added value: +"macOS only. Named controls to measure: {\"name\": {\"element\": \"label\", \"role\"?: \"button\", \"nth\"?: 0, \"exact\"?: true}}."
  2. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare this read-only, idempotent and non-destructive, and the description adds substantial context beyond them: platform-specific occlusion behavior (macOS hides covered windows, Windows/Linux fallback grabs the screen area), the Screen Recording permission requirement, the Accessibility permission needed for targets, and that a PNG is written to temp. The PNG artifact write is disclosed rather than hidden and is an output artifact, not a mutation of the target, so it does not contradict readOnlyHint.

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?

Dense but front-loaded: the one-line core behavior plus the sibling routing comes first, and platform caveats and return details follow. Every sentence carries information, though the targets/permission material is packed into a long clause that could be marginally tightened.

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?

No output schema exists, and the description compensates by enumerating the return payload (path, size, window_id, rects, scale, preview). Combined with platform requirements and sibling routing, an agent has everything needed to invoke it correctly.

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 100%, so the baseline is 3, but the description adds real semantic value: it explains that targets is macOS-only, that it measures buttons and fields through Accessibility, that the named spec is {name: {element, role, nth, exact}}, and that the call returns rects plus the scale needed for the annotate spec.

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: screenshot one window by id, sourced from list_windows. It immediately distinguishes itself from siblings by name, contrasting capture_window with capture_screen (several windows) and capture_web (web pages).

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?

Explicit when-to-use with named alternatives: 'Use it for desktop apps; capture_screen for several windows, capture_web for web pages.' It also constrains scope by noting it never moves, resizes or focuses the window, so the agent knows what side effects to expect from the call.

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