Skip to main content
Glama

mobile_save_screenshot

Capture and save a screenshot from a mobile device to a specified file path using a platform-agnostic automation server for iOS and Android applications.

Instructions

Save a screenshot of the mobile device to a file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
saveToYesThe path to save the screenshot to

Implementation Reference

  • src/server.ts:384-397 (registration)
    Registration of the 'mobile_save_screenshot' tool, including input schema (saveTo path) and inline handler. The handler requires a previously selected device/robot, fetches the screenshot buffer via robot.getScreenshot(), and writes it to the specified file path using Node.js fs.writeFileSync.
    tool( "mobile_save_screenshot", "Save a screenshot of the mobile device to a file", { saveTo: z.string().describe("The path to save the screenshot to"), }, async ({ saveTo }) => { requireRobot(); const screenshot = await robot!.getScreenshot(); fs.writeFileSync(saveTo, screenshot); return `Screenshot saved to: ${saveTo}`; } );
  • The core handler function for 'mobile_save_screenshot' that executes the tool logic: ensures a robot/device is selected, captures the screenshot, saves to file, and returns confirmation.
    async ({ saveTo }) => { requireRobot(); const screenshot = await robot!.getScreenshot(); fs.writeFileSync(saveTo, screenshot); return `Screenshot saved to: ${saveTo}`; }
  • Zod schema for 'mobile_save_screenshot' tool input: requires 'saveTo' string parameter specifying the file path.
    { saveTo: z.string().describe("The path to save the screenshot to"), },

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