Skip to main content
Glama

Get Orientation

mobile_get_orientation
Read-only

Retrieve the current screen orientation of a mobile device for automation testing or UI adaptation, using the device identifier from available options.

Instructions

Get the current screen orientation of the device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceYesThe device identifier to use. Use mobile_list_available_devices to find which devices are available to you.

Implementation Reference

  • src/server.ts:464-475 (registration)
    Registration of the 'mobile_get_orientation' MCP tool. The inline handler requires an active device/robot and delegates to its getOrientation() method, formatting the result as a string.
    tool(
    	"mobile_get_orientation",
    	"Get the current screen orientation of the device",
    	{
    		noParams
    	},
    	async () => {
    		requireRobot();
    		const orientation = await robot!.getOrientation();
    		return `Current device orientation is ${orientation}`;
    	}
    );
  • AndroidRobot implementation of getOrientation(): queries device settings via adb for user_rotation (0=portrait, else landscape).
    public async getOrientation(): Promise<Orientation> {
    	const rotation = this.adb("shell", "settings", "get", "system", "user_rotation").toString().trim();
    	return rotation === "0" ? "portrait" : "landscape";
    }
  • WebDriverAgent implementation of getOrientation() used by iOS devices and simulators: performs HTTP GET to /orientation endpoint within a WDA session and lowercases the result.
    public async getOrientation(): Promise<Orientation> {
    	return this.withinSession(async sessionUrl => {
    		const url = `${sessionUrl}/orientation`;
    		const response = await fetch(url);
    		const json = await response.json();
    		return json.value.toLowerCase() as Orientation;
    	});
    }
Behavior4/5

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

The annotations provide readOnlyHint=true, indicating this is a safe read operation. The description adds value by specifying what information is retrieved (screen orientation) and that it's current/real-time data. It doesn't contradict annotations, and while it doesn't mention rate limits or authentication needs, the annotations cover the safety profile adequately for this simple query tool.

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, clear sentence that directly states the tool's purpose without any wasted words. It's front-loaded with the core functionality and appropriately sized for a simple read operation.

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

Completeness4/5

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

For a simple read tool with one parameter fully documented in the schema and readOnlyHint annotations, the description provides adequate context about what information is retrieved. The main gap is the lack of output schema, but the description implies the return value (orientation information), making it reasonably complete for this complexity level.

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?

With 100% schema description coverage, the input schema fully documents the single required 'device' parameter. The description doesn't add any parameter-specific information beyond what's in the schema, so it meets the baseline of 3 for high schema coverage without compensating value.

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 specific action ('Get') and resource ('current screen orientation of the device'), distinguishing it from sibling tools like mobile_set_orientation (which sets orientation) and mobile_get_screen_size (which gets screen dimensions). The verb+resource combination is precise and unambiguous.

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

Usage Guidelines4/5

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

The description implies usage context (when you need to know the device's orientation), and the input schema's parameter description provides guidance on how to obtain the device identifier via mobile_list_available_devices. However, it doesn't explicitly state when NOT to use this tool or compare it to alternatives like mobile_get_screen_size, which is a minor gap.

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/EmpathySlainLovers/MCP'

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