Skip to main content
Glama
rahulkr
by rahulkr

rotate_screen

Change Android device screen orientation for testing and development. Supports portrait, landscape, reverse orientations, and auto-rotation modes.

Instructions

Rotate screen orientation.
orientation: 'portrait', 'landscape', 'reverse_portrait', 'reverse_landscape', or 'auto'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orientationNoportrait
device_serialNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The rotate_screen tool implementation. Decorated with @mcp.tool() for MCP registration. Handles screen rotation by setting ADB system settings for accelerometer_rotation and user_rotation based on the specified orientation.
    @mcp.tool()
    def rotate_screen(orientation: str = "portrait", device_serial: str | None = None) -> str:
        """
        Rotate screen orientation.
        orientation: 'portrait', 'landscape', 'reverse_portrait', 'reverse_landscape', or 'auto'
        """
        orientations = {
            'auto': ('0', 'user'),
            'portrait': ('1', '0'),
            'landscape': ('1', '1'),
            'reverse_portrait': ('1', '2'),
            'reverse_landscape': ('1', '3')
        }
        
        if orientation not in orientations:
            return f"Invalid orientation. Use: {list(orientations.keys())}"
        
        accel_rotation, user_rotation = orientations[orientation]
        
        if orientation == 'auto':
            run_adb(["shell", "settings", "put", "system", "accelerometer_rotation", "1"], device_serial)
        else:
            run_adb(["shell", "settings", "put", "system", "accelerometer_rotation", "0"], device_serial)
            run_adb(["shell", "settings", "put", "system", "user_rotation", user_rotation], device_serial)
        
        return f"Screen rotation set to {orientation}"
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Rotate') which implies a mutation, but doesn't disclose whether this requires specific permissions, affects device state persistently, has side effects (e.g., on apps), or what the output includes. The description adds minimal context beyond the basic action, leaving key behavioral traits unspecified.

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 and front-loaded, with the purpose stated in the first three words and parameter details following directly. Every sentence earns its place by providing essential information without redundancy. The structure is efficient, with no wasted words, making it easy to parse quickly.

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's moderate complexity (mutation with 2 parameters) and the presence of an output schema (which reduces the need to describe return values), the description is partially complete. It excels in parameter semantics but lacks behavioral context, usage guidelines, and integration with sibling tools. The output schema likely covers return values, but the description doesn't address mutation risks or device-specific considerations, leaving gaps in overall context.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant meaning beyond the input schema, which has 0% schema description coverage. It explicitly defines the valid values for the 'orientation' parameter ('portrait', 'landscape', 'reverse_portrait', 'reverse_landscape', or 'auto'), providing crucial semantics that the schema lacks. This compensates fully for the schema's deficiency, making parameter usage clear and actionable.

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 ('Rotate screen orientation') and identifies the resource ('screen'), making the purpose immediately understandable. It distinguishes itself from siblings like 'change_screen_size' or 'screenshot' by focusing on orientation rather than size or capture. However, it doesn't explicitly differentiate from all possible alternatives in the sibling list, such as device-specific controls.

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, prerequisites, or context. It doesn't mention whether this is for testing, accessibility, or general device control, nor does it reference sibling tools like 'change_screen_size' or 'get_screen_specs' for related operations. Usage is implied through the parameter explanation 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