Skip to main content
Glama

mobile_set_orientation

Adjust device screen orientation to portrait or landscape using the Mobile Next MCP server for automated mobile testing and interaction.

Instructions

Change the screen orientation of the device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orientationYesThe desired orientation

Implementation Reference

  • MCP tool registration including schema, description, and handler logic for 'mobile_set_orientation'. The handler requires a selected robot (device) and delegates to its setOrientation method.
    tool( "mobile_set_orientation", "Change the screen orientation of the device", { orientation: z.enum(["portrait", "landscape"]).describe("The desired orientation"), }, async ({ orientation }) => { requireRobot(); await robot!.setOrientation(orientation); return `Changed device orientation to ${orientation}`; } );
  • Zod schema for the tool input parameter 'orientation'.
    orientation: z.enum(["portrait", "landscape"]).describe("The desired orientation"),
  • Robot interface defining the setOrientation method called by the tool handler.
    * Change the screen orientation of the device. * @param orientation The desired orientation ("portrait" or "landscape") */ setOrientation(orientation: Orientation): Promise<void>; /** * Get the current screen orientation. */ getOrientation(): Promise<Orientation>; }
  • AndroidRobot implementation of setOrientation using adb to set user_rotation.
    public async setOrientation(orientation: Orientation): Promise<void> {
  • IosRobot implementation delegating to WebDriverAgent.
    public async setOrientation(orientation: Orientation): Promise<void> {

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