Skip to main content
Glama

get-screenshot

Capture a screenshot of the current web page in the browser for documentation, testing, or analysis purposes.

Instructions

Get a screenshot of the current page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'get-screenshot' MCP tool, including its handler function that takes a full page screenshot and returns it as a base64 PNG image.
    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", }, ], }; } )
  • The handler function executes page.screenshot() to capture the full current page as PNG, logs the event, and returns the base64 image 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