Skip to main content
Glama

playwright_get

Execute HTTP GET requests directly within a browser automation workflow using Playwright, enabling automated retrieval of web content from specified URLs via MCP Browser Automation Server.

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

  • The execution handler for the 'playwright_get' tool. It uses the pre-initialized APIRequestContext to perform a GET request to the specified URL, returns response JSON and status code.
    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 and metadata definition for the 'playwright_get' tool, requiring a 'url' string 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"], }, },
  • API_TOOLS constant lists 'playwright_get' among API-only tools, used to conditionally initialize APIRequestContext without launching a browser.
    export const API_TOOLS = [ "playwright_get", "playwright_post", "playwright_put", "playwright_delete", "playwright_patch" ];
  • Helper function to create a Playwright APIRequestContext with baseURL set to the tool's url argument, used for all API tools including playwright_get.
    async function ensureApiContext(url: string) { return await request.newContext({ baseURL: url, }); }
  • src/index.ts:23-26 (registration)
    Registration of all tools including 'playwright_get' by creating definitions from tools.ts and passing to setupRequestHandlers on the MCP server.
    const TOOLS = createToolDefinitions(); // Setup request handlers setupRequestHandlers(server, TOOLS);

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/hrmeetsingh/mcp-browser-automation'

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