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
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to perform GET operation |
Implementation Reference
- src/toolsHandler.ts:314-342 (handler)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, }; }
- src/tools.ts:94-104 (schema)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"], }, }, ];