Skip to main content
Glama

Get Screen Size

mobile_get_screen_size
Read-only

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({});
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, indicating a safe read operation. The description adds no behavioral traits beyond this (e.g., performance, rate limits, or return format details). It doesn't contradict annotations, but provides minimal additional context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words, clearly front-loading the tool's purpose. It's appropriately sized for a simple read operation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read tool with one parameter fully covered by schema and readOnlyHint annotation, the description is mostly complete. However, without an output schema, it doesn't specify the return format (e.g., dimensions structure), leaving a minor gap in context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'device' fully documented in the schema. The description adds no parameter-specific information beyond what the schema provides, so it meets the baseline for high coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get') and resource ('screen size of the mobile device in pixels'), distinguishing it from siblings like mobile_get_orientation (orientation) or mobile_list_elements_on_screen (UI elements). It precisely defines what the tool retrieves.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when screen size information is needed, and the input schema's parameter description provides explicit guidance to use mobile_list_available_devices to find devices. However, it doesn't explicitly state when not to use this tool or name alternatives for related queries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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