Skip to main content
Glama

playwright_get

Execute HTTP GET requests to retrieve web content through browser automation, enabling data extraction and web interaction via the Chrome DevTools Protocol.

Instructions

Perform an HTTP GET request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to perform GET operation

Implementation Reference

  • The handler logic for the 'playwright_get' tool. It executes an HTTP GET request using Playwright's APIRequestContext on the provided URL, parses the JSON response, retrieves the status code, and formats the output as tool content blocks.
    case "playwright_get": try { var response = await apiContext!.get(args.url); return { 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 { content: [{ type: "text", text: `Failed to perform GET operation on ${args.url}: ${(error as Error).message}`, }], isError: true, }; }
  • The input schema definition for the 'playwright_get' tool, specifying a required '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"], }, },
  • src/tools.ts:166-173 (registration)
    Registration of 'playwright_get' as part of the API_TOOLS array, likely used for conditional browser or context launching.
    // API Request tools for conditional launch export const API_TOOLS = [ "playwright_get", "playwright_post", "playwright_put", "playwright_delete", "playwright_patch" ];
  • src/tools.ts:36-152 (registration)
    The 'playwright_get' tool is included in the main TOOLS export array, which serves as the central registration point for all MCP tools.
    }, { name: "playwright_click", description: "Click an element on the page", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to click" }, }, required: ["selector"], }, }, { name: "playwright_fill", description: "fill out an input field", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for input field" }, value: { type: "string", description: "Value to fill" }, }, required: ["selector", "value"], }, }, { name: "playwright_select", description: "Select an element on the page with Select tag", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to select" }, value: { type: "string", description: "Value to select" }, }, required: ["selector", "value"], }, }, { name: "playwright_hover", description: "Hover an element on the page", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to hover" }, }, required: ["selector"], }, }, { name: "playwright_evaluate", description: "Execute JavaScript in the browser console", inputSchema: { type: "object", properties: { script: { type: "string", description: "JavaScript code to execute" }, }, required: ["script"], }, }, { name: "playwright_get", description: "Perform an HTTP GET request", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to perform GET operation" } }, required: ["url"], }, }, { name: "playwright_post", description: "Perform an HTTP POST request", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to perform POST operation" }, value: { type: "string", description: "Data to post in the body" }, }, required: ["url", "value"], }, }, { name: "playwright_put", description: "Perform an HTTP PUT request", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to perform PUT operation" }, value: { type: "string", description: "Data to PUT in the body" }, }, required: ["url", "value"], }, }, { name: "playwright_patch", description: "Perform an HTTP PATCH request", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to perform PUT operation" }, value: { type: "string", description: "Data to PATCH in the body" }, }, required: ["url", "value"], }, }, { name: "playwright_delete", description: "Perform an HTTP DELETE request", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to perform DELETE operation" } }, required: ["url"], }, }, ];

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/lars-hagen/mcp-playwright-cdp'

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