Skip to main content
Glama

Rotate the screen

android_set_rotation
Idempotent

Set the Android display to a specific orientation for layout testing, or switch back to auto-rotate. Useful for checking UI in portrait and landscape modes.

Instructions

Force the display into a specific orientation, or hand control back to the accelerometer.

Setting a fixed rotation turns auto-rotate off first; otherwise the sensor immediately overrides it. Use 'auto' to restore normal behaviour.

Rotating is the fastest way to check a layout in both orientations. Note that an app locking its own orientation in the manifest wins over this — the display will not turn.

Args:

  • orientation ('portrait' | 'landscape' | 'portrait_reverse' | 'landscape_reverse' | 'auto')

  • serial (string, optional): target device

Returns: { "requested": string, "rotationDegrees": number, "serial": string }

Examples:

  • Use when: checking a tablet layout in landscape -> orientation="landscape"

  • Use when: restoring the device after testing -> orientation="auto"

  • Don't use when: the app declares a fixed screenOrientation; change the manifest instead

Error Handling:

  • If the reported rotation does not change, the foreground app is locking its orientation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serialNoDevice serial from android_list_devices. Optional when exactly one device is connected; required when several are.
orientationYesTarget orientation, or 'auto' to re-enable the accelerometer.
Behavior5/5

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

The description discloses key behavioral traits beyond annotations: fixed rotation disables auto-rotate first, sensor might override, app manifest lockdown wins, and how to detect failure. This significantly expands on the annotation hints without contradicting them.

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 well-structured with sections for Args, Returns, Examples, and Error Handling. Despite containing substantial detail, every sentence earns its place, and the structure makes it easy for an agent to scan.

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

Completeness5/5

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

Given no output schema, the description supplies a return shape, error handling clues, and practical examples. It covers the essential context needed to select and invoke the tool correctly, making it complete for a tool with only two parameters.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds value by explaining the behavioral meaning of orientation values (fixed vs auto) and the effect of auto-rotate override, which goes beyond the schema's dry enum listing. It reinforces but doesn't fully reinvent parameter semantics.

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

Purpose5/5

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

The description clearly states the tool's purpose: force a display into a specific orientation or restore accelerometer control. It distinguishes this from sibling Android tools by specifying both the action ('force') and the resource ('display').

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

Usage Guidelines5/5

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

Provides explicit 'Use when' and 'Don't use when' examples, including a concrete alternative ('change the manifest') for apps with fixed orientation. Also explains when to use 'auto' to restore normal behavior, giving clear situational context.

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/jjs03111/android-build-mcp'

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