Skip to main content
Glama

record_screen

Record Android device screen activity to specified output file for set duration to capture visual workflows and interactions.

Instructions

Record the screen of the connected Android device for a specified duration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
output_pathYes
durationYes

Implementation Reference

  • The handler function for the 'record_screen' tool, decorated with @mcp.tool() for registration. It records the Android device screen using 'adb shell screenrecord' for the specified duration and pulls the MP4 file to the local output_path.
    @mcp.tool()
    def record_screen(output_path: str, duration: int) -> str:
        """Record the screen of the connected Android device for a specified duration"""
        timestamp = datetime.now().strftime("%Y%m%d%H%M%S")
        file = f"/sdcard/espresso-mcp_recording_{timestamp}.mp4"
        result = subprocess.run(
            ["adb", "shell", "screenrecord", file],
            capture_output=True,
            text=True,
            timeout=duration,
        )
        if result.returncode != 0:
            raise RuntimeError(f"Error recording screen: {result.stderr}")
    
        pull_result = subprocess.run(
            ["adb", "pull", file, output_path],
            capture_output=True,
            text=True,
        )
        if pull_result.returncode != 0:
            raise RuntimeError(f"Error pulling recorded file: {pull_result.stderr}")
        return f"Screen recording saved to '{output_path}'."
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. It states what the tool does but lacks critical behavioral details: it doesn't specify file format, quality settings, whether recording happens in background/foreground, permissions required, or what happens if device disconnects during recording. For a tool with potential side effects and no annotation coverage, this is insufficient.

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 that states the core functionality without unnecessary words. It's appropriately sized for a tool with two parameters and gets straight to the point with zero 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?

Given a tool with no annotations, no output schema, and 0% schema description coverage for both required parameters, the description is incomplete. It doesn't explain what the tool returns (success/failure status, file location confirmation), doesn't cover error conditions, and leaves key behavioral aspects undocumented. For a recording tool with potential side effects, this level of documentation is inadequate.

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?

With 0% schema description coverage for both parameters, the description provides no additional parameter semantics beyond what's implied by the tool name. It mentions 'specified duration' which relates to the 'duration' parameter, but doesn't explain units (seconds, milliseconds?), valid ranges, or what 'output_path' should contain (file path format, extension requirements). The description fails to compensate for the complete lack of schema documentation.

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 action ('Record') and target resource ('screen of the connected Android device'), specifying the duration aspect. It distinguishes from siblings like 'take_screenshot' by indicating continuous recording rather than a single capture. However, it doesn't explicitly differentiate from all possible screen-related tools that might exist in other contexts.

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 'take_screenshot' or other screen-related operations. It mentions 'connected Android device' which implies device connectivity is required, but doesn't state prerequisites, exclusions, or comparative use cases with sibling tools.

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/vs4vijay/espresso-mcp'

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