Skip to main content
Glama

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') }

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