Skip to main content
Glama

mobile_get_screen_size

Retrieve the screen size in pixels of a mobile device, enabling precise interaction and automation for iOS and Android applications via the Mobile Next MCP server.

Instructions

Get the screen size of the mobile device in pixels

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noParamsYes

Implementation Reference

  • The handler function for the 'mobile_get_screen_size' tool. It requires a device to be selected via robot, fetches the screen size using robot.getScreenSize(), and formats it as a string response.
    tool( "mobile_get_screen_size", "Get the screen size of the mobile device in pixels", { noParams }, async ({}) => { requireRobot(); const screenSize = await robot!.getScreenSize(); return `Screen size is ${screenSize.width}x${screenSize.height} pixels`; } );
  • Shared schema for tools with no input parameters, used by 'mobile_get_screen_size'.
    const noParams = z.object({});
  • Type definition for ScreenSize returned by getScreenSize() method used in the tool handler.
    export interface ScreenSize extends Dimensions { scale: number; }
  • Interface definition for the getScreenSize() method called by the tool handler.
    getScreenSize(): Promise<ScreenSize>;

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