Skip to main content
Glama
cloudflare

Cloudflare Playwright MCP

Official
by cloudflare

browser_snapshot

Capture accessibility snapshots of web pages using Playwright for enhanced testing and analysis beyond standard screenshots, integrated with Cloudflare Workers for browser automation.

Instructions

Capture accessibility snapshot of the current page, this is better than screenshot

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'browser_snapshot' tool. It ensures a tab is active and returns a response instructing the system to capture an accessibility snapshot of the page.
    handle: async context => { await context.ensureTab(); return { code: [`// <internal code to capture accessibility snapshot>`], captureSnapshot: true, waitForNetwork: false, }; },
  • Input schema and metadata definition for the 'browser_snapshot' tool using Zod. It has no input parameters and is marked as read-only.
    schema: { name: 'browser_snapshot', title: 'Page snapshot', description: 'Capture accessibility snapshot of the current page, this is better than screenshot', inputSchema: z.object({}), type: 'readOnly', },
  • src/tools.ts:35-50 (registration)
    Registers the 'browser_snapshot' tool by spreading the imported 'snapshot' module into the main 'snapshotTools' array, which collects all core tools.
    export const snapshotTools: Tool<any>[] = [ ...common(true), ...console, ...dialogs(true), ...files(true), ...install, ...keyboard(true), ...navigate(true), ...network, ...pdf, ...screenshot, ...snapshot, ...tabs(true), ...testing, ...wait(true), ];
  • Module-level registration exporting 'browser_snapshot' (named 'snapshot') along with related browser interaction tools.
    export default [ snapshot, click, drag, hover, type, selectOption, ];

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

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