playwright_get
Execute HTTP GET requests to retrieve data from specified URLs using a real browser environment, enabling interactions with web pages for testing, scraping, or content extraction.
Instructions
Perform an HTTP GET request
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to perform GET operation |
Input Schema (JSON Schema)
{
"properties": {
"url": {
"description": "URL to perform GET operation",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
}
Implementation Reference
- src/tools/api/requests.ts:7-29 (handler)The execute method of GetRequestTool performs the HTTP GET request using the API context, retrieves the response text and status, and formats a success response.export class GetRequestTool extends ApiToolBase { /** * Execute the GET request tool */ async execute(args: any, context: ToolContext): Promise<ToolResponse> { return this.safeExecute(context, async (apiContext) => { const response = await apiContext.get(args.url); let responseText; try { responseText = await response.text(); } catch (error) { responseText = "Unable to get response text"; } return createSuccessResponse([ `GET request to ${args.url}`, `Status: ${response.status()} ${response.statusText()}`, `Response: ${responseText.substring(0, 1000)}${responseText.length > 1000 ? '...' : ''}` ]); }); } }
- src/tools.ts:219-228 (schema)The input schema definition for the 'playwright_get' tool, specifying the 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"], }, },
- src/toolHandler.ts:502-503 (registration)Registration in the main tool handler switch statement that routes calls to 'playwright_get' to the GetRequestTool instance.case "playwright_get": return await getRequestTool.execute(args, context);
- src/toolHandler.ts:304-304 (registration)Instantiation of the GetRequestTool class instance used for handling 'playwright_get' calls.if (!getRequestTool) getRequestTool = new GetRequestTool(server);
- src/tools.ts:429-429 (schema)Inclusion of 'playwright_get' in the API_TOOLS array for conditional browser/API context initialization."playwright_get",