Skip to main content
Glama

playwright_get

Send an HTTP GET request to a specified URL, enabling interaction with web pages or fetching data through the Playwright MCP Server for browser automation tasks.

Instructions

Perform an HTTP GET request

Input Schema

NameRequiredDescriptionDefault
urlYesURL to perform GET operation

Input Schema (JSON Schema)

{ "properties": { "url": { "description": "URL to perform GET operation", "type": "string" } }, "required": [ "url" ], "type": "object" }

Implementation Reference

  • Handler implementation for 'playwright_get' tool: performs HTTP GET request using Playwright's APIRequestContext.get(), returns response JSON and status code, or error message.
    case "playwright_get": try { var response = await apiContext!.get(args.url); return { toolResult: { content: [{ type: "text", text: `Performed GET Operation ${args.url}`, }, { type: "text", text: `Response: ${JSON.stringify(await response.json(), null, 2)}`, }, { type: "text", text: `Response code ${response.status()}` } ], isError: false, }, }; } catch (error) { return { toolResult: { content: [{ type: "text", text: `Failed to perform GET operation on ${args.url}: ${(error as Error).message}`, }], isError: true, }, }; }
  • Input schema definition for 'playwright_get' tool, specifying required 'url' parameter.
    { name: "playwright_get", description: "Perform an HTTP GET request", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to perform GET operation" } }, required: ["url"], }, },
  • Helper array listing API request tools including 'playwright_get', used to conditionally initialize APIRequestContext in the handler.
    export const API_TOOLS = [ "playwright_get", "playwright_post", "playwright_put", "playwright_delete", "playwright_patch" ];
  • Registers the MCP list_tools request handler, which returns the tool definitions array including 'playwright_get'.
    // List tools handler server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: tools, }));
  • src/index.ts:22-26 (registration)
    Initializes the tools array from createToolDefinitions() and sets up request handlers passing the tools for registration.
    // Create tool definitions const TOOLS = createToolDefinitions(); // Setup request handlers setupRequestHandlers(server, 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/lebrodus/mcp-playwright'

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