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
| Name | Required | Description | Default |
|---|---|---|---|
| noParams | Yes |
Implementation Reference
- src/server.ts:250-261 (handler)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`; } );
- src/server.ts:50-50 (schema)Shared schema for tools with no input parameters, used by 'mobile_get_screen_size'.const noParams = z.object({});
- src/robot.ts:6-8 (helper)Type definition for ScreenSize returned by getScreenSize() method used in the tool handler.export interface ScreenSize extends Dimensions { scale: number; }
- src/robot.ts:51-51 (helper)Interface definition for the getScreenSize() method called by the tool handler.getScreenSize(): Promise<ScreenSize>;