Skip to main content
Glama
rahulkr
by rahulkr

capture_screen_for_comparison

Capture device screenshots with metadata to compare visual designs against Figma mockups during Android app development and testing.

Instructions

Capture screenshot with metadata for visual comparison. Saves PNG and returns info for comparing with Figma designs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
screen_nameYes
output_dirNo./screenshots
device_serialNo

Implementation Reference

  • The primary handler function decorated with @mcp.tool(), which implements the capture_screen_for_comparison tool. It takes a screen_name, optional output_dir and device_serial, captures the screen using ADB screencap, saves the PNG file locally, and returns comprehensive metadata including device specs, current activity, file info, and base64-encoded image.
    @mcp.tool()
    def capture_screen_for_comparison(
        screen_name: str,
        output_dir: str = "./screenshots",
        device_serial: str | None = None
    ) -> dict:
        """
        Capture screenshot with metadata for visual comparison.
        Saves PNG and returns info for comparing with Figma designs.
        """
        os.makedirs(output_dir, exist_ok=True)
        
        # Get device specs
        specs = get_screen_specs(device_serial)
        activity = get_current_activity(device_serial)
        
        # Capture screenshot
        timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
        filename = f"{screen_name}_{timestamp}.png"
        filepath = os.path.join(output_dir, filename)
        
        img_data = run_adb_binary(["exec-out", "screencap", "-p"], device_serial)
        with open(filepath, 'wb') as f:
            f.write(img_data)
        
        return {
            "filepath": filepath,
            "filename": filename,
            "screen_name": screen_name,
            "timestamp": timestamp,
            "device_specs": specs,
            "current_activity": activity,
            "size_bytes": len(img_data),
            "base64": base64.b64encode(img_data).decode('utf-8')
        }
Behavior2/5

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

With no annotations provided, the description carries full burden. It mentions saving PNG files and returning comparison info, but lacks critical behavioral details: whether this requires device access, if it's a blocking operation, error conditions, or what specific metadata is captured. The description is insufficient for a mutation tool (file creation) 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.

Conciseness5/5

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

The description is extremely concise with just two sentences that directly state the tool's purpose and output. Every word earns its place, and the information is front-loaded with no wasted text.

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

Completeness2/5

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

For a tool that creates files (PNG outputs) and returns comparison data with no output schema and 0% schema description coverage, the description is incomplete. It doesn't explain the return format, error handling, device requirements, or how the comparison metadata is structured. The context signals indicate significant gaps in documentation.

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

Parameters2/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. It mentions 'screenshot with metadata' but doesn't explain what the three parameters (screen_name, output_dir, device_serial) mean or how they affect the capture. No parameter semantics are provided beyond what's in the bare schema titles.

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

Purpose4/5

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

The description clearly states the tool captures screenshots with metadata for visual comparison, specifying the output format (PNG) and comparison target (Figma designs). It distinguishes from the generic 'screenshot' and 'screenshot_to_file' siblings by emphasizing comparison functionality, though it doesn't explicitly contrast with them.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus the similar 'screenshot' or 'screenshot_to_file' tools, nor does it mention prerequisites, alternatives, or exclusions. Usage context is implied through the comparison purpose but not explicitly stated.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rahulkr/r_adb_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server