Skip to main content
Glama

playwright_get

Execute HTTP GET requests in a browser environment using the MCP Playwright server, allowing LLMs to retrieve web page content and interact with URLs programmatically.

Instructions

Perform an HTTP GET request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to perform GET operation

Implementation Reference

  • Implements the core handler logic for the 'playwright_get' tool. Performs an HTTP GET request using Playwright's APIRequestContext and returns status and truncated response body.
    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 ? '...' : ''}` ]); }); } }
  • Defines the tool schema including name, description, and input validation schema requiring a '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"], }, },
  • Registers the tool handler dispatch in the main switch statement of handleToolCall function.
    case "playwright_get": return await getRequestTool.execute(args, context);
  • Lazily instantiates the GetRequestTool (and other API tools) in the initializeTools function called before handling tool calls.
    // API tools if (!getRequestTool) getRequestTool = new GetRequestTool(server); if (!postRequestTool) postRequestTool = new PostRequestTool(server); if (!putRequestTool) putRequestTool = new PutRequestTool(server); if (!patchRequestTool) patchRequestTool = new PatchRequestTool(server); if (!deleteRequestTool) deleteRequestTool = new DeleteRequestTool(server);

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/executeautomation/mcp-playwright'

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