Skip to main content
Glama
devskido

Playwright MCP Server

by devskido

playwright_get

Perform HTTP GET requests to retrieve web content using browser automation, enabling web scraping and data extraction from live pages.

Instructions

Perform an HTTP GET request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to perform GET operation

Implementation Reference

  • GetRequestTool class with execute method that performs HTTP GET request using Playwright API context, fetches response text, and returns formatted status and truncated 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 ? '...' : ''}` ]); }); } }
  • Tool schema definition including name, description, and input schema requiring '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"], }, },
  • Dispatch in handleToolCall function routing 'playwright_get' tool calls to the GetRequestTool instance.
    case "playwright_get": return await getRequestTool.execute(args, context);
  • Initialization of the GetRequestTool instance used for handling the tool.
    if (!getRequestTool) getRequestTool = new GetRequestTool(server);
  • Setup of API request context for API tools including playwright_get before executing the handler.
    context.apiContext = await ensureApiContext(args.url); } catch (error) {

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/devskido/customed-playwright'

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