Skip to main content
Glama

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
NameRequiredDescriptionDefault
deviceYesThe device identifier to use. Use mobile_list_available_devices to find which devices are available to you.

Implementation Reference

  • 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`; } );
  • Shared empty schema object used for tools with no parameters, including mobile_get_screen_size.
    const noParams = z.object({});

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