mobile_get_screen_size
Retrieve the screen dimensions in pixels for a specified mobile device, enabling accurate UI testing and automation by providing essential display information.
Instructions
Get the screen size of the mobile device in pixels
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device | Yes | The device identifier to use. Use mobile_list_available_devices to find which devices are available to you. |
Implementation Reference
- src/server.ts:250-261 (handler)The handler function for the 'mobile_get_screen_size' tool. It requires an active robot (device), calls getScreenSize() on it, and formats the response with width x height.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:250-261 (registration)Registers the 'mobile_get_screen_size' tool with the MCP server using the wrapper 'tool' function, including schema (noParams), description, and handler.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 empty schema object used for tools with no parameters, including mobile_get_screen_size.const noParams = z.object({});