Skip to main content
Glama

get-screenshot

Capture a screenshot of the current webpage for documentation, debugging, or testing purposes. Integrated with Playwright MCP server to streamline web page interactions and enhance development workflows.

Instructions

Get a screenshot of the current page

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": {}, "type": "object" }

Implementation Reference

  • Registration of the 'get-screenshot' tool, including its inline handler function that captures a full-page PNG screenshot using Playwright's page.screenshot() and returns it as base64 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", }, ], }; } )
  • The handler function for 'get-screenshot' tool: logs the event, takes a PNG screenshot of the current page, converts to base64, and returns as image content in MCP 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", }, ], }; }

Other Tools

Related 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/Ashish-Bansal/playwright-mcp'

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