Skip to main content
Glama
rahulkr
by rahulkr

screenshot_to_file

Capture Android device screenshots and save them directly to local files for visual testing, debugging, or documentation purposes.

Instructions

Save screenshot to a local file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameNoscreenshot.png
device_serialNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function decorated with @mcp.tool(), implementing the screenshot_to_file tool. Captures screenshot using ADB screencap command and writes the binary PNG data to the specified local file.
    @mcp.tool()
    def screenshot_to_file(
        filename: str = "screenshot.png",
        device_serial: str | None = None
    ) -> str:
        """Save screenshot to a local file"""
        img_data = run_adb_binary(["exec-out", "screencap", "-p"], device_serial)
        
        if not img_data or len(img_data) < 100:
            return "Error: Failed to capture screenshot"
        
        with open(filename, 'wb') as f:
            f.write(img_data)
        
        return f"Screenshot saved to {filename} ({len(img_data)} bytes)"
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Save screenshot to a local file' implies a write operation that creates or modifies files, but doesn't specify where files are saved (local to what?), permissions needed, file format constraints, or error conditions. It mentions 'local file' which adds some context about storage location, but lacks details on behavior like overwriting existing files or path resolution.

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 a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a simple tool. Every word earns its place.

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

Completeness3/5

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

Given the tool has an output schema (which handles return values) and relatively simple parameters with defaults, the description is minimally adequate. However, as a file-writing tool with no annotations, it should ideally mention more about file system behavior, permissions, or error handling. The description covers the basic purpose but leaves important behavioral aspects unspecified.

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 0%, so the schema provides no parameter descriptions. The tool description doesn't mention either parameter (filename or device_serial), so it adds no semantic value beyond what's inferred from parameter names. With 2 parameters and 0% schema coverage, the description fails to compensate, but since parameters have default values and clear titles, the baseline is 3.

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 'Save screenshot to a local file' clearly states the action (save) and resource (screenshot), making the purpose immediately understandable. However, it doesn't differentiate from the sibling 'screenshot' tool, which appears to be a similar screenshot-related function. The description is specific but lacks sibling distinction.

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 alternatives like 'screenshot' or 'capture_screen_for_comparison'. There's no mention of prerequisites, constraints, or typical use cases. The agent must infer usage from the name and parameters alone.

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