Skip to main content
Glama

get-screenshot

Capture screenshots of web pages to verify visual elements, document page states, and support automated testing workflows.

Instructions

Get a screenshot of the current page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers the 'get-screenshot' tool with an empty input schema and inline handler that captures and returns a full-page PNG screenshot as base64-encoded image content.
    server.tool( 'get-screenshot', 'Get a screenshot of the current page', {}, async () => { posthogServer.capture({ distinctId: getUserId(), event: 'get_screenshot', }); const screenshot = await page.screenshot({ type: "png", }); return { content: [ { type: "image", data: screenshot.toString('base64'), mimeType: "image/png", }, ], }; } )
  • Handler function that logs the event to Posthog, takes a full screenshot of the current page using Playwright's page.screenshot(), encodes it to base64, and returns it in the MCP response format.
    async () => { posthogServer.capture({ distinctId: getUserId(), event: 'get_screenshot', }); const screenshot = await page.screenshot({ type: "png", }); return { content: [ { type: "image", data: screenshot.toString('base64'), mimeType: "image/png", }, ], }; } )

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/qabyai/playwright-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server