Skip to main content
Glama

playwright_get

Execute HTTP GET requests to retrieve web content for browser automation tasks using Playwright's capabilities.

Instructions

Perform an HTTP GET request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to perform GET operation

Implementation Reference

  • GetRequestTool class containing the execute method that performs the HTTP GET request using Playwright's APIRequestContext, retrieves the response text, status, and formats the output.
    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: string;
          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 inputSchema 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"],
      },
    },
  • Switch case in handleToolCall function that registers and routes the 'playwright_get' tool call to the GetRequestTool's execute method.
    case "playwright_get":
      return await getRequestTool.execute(args, context);
  • safeExecute method in ApiToolBase class used by GetRequestTool for safe API context validation and error handling.
    protected async safeExecute(
      context: ToolContext,
      operation: (apiContext: APIRequestContext) => Promise<ToolResponse>,
    ): Promise<ToolResponse> {
      const apiError = this.validateApiContextAvailable(context);
      if (apiError) return apiError;
    
      try {
        return await operation(context.apiContext!);
      } catch (error) {
        return createErrorResponse(`API operation failed: ${(error as Error).message}`);
      }
    }
  • src/tools.ts:519-525 (registration)
    API_TOOLS constant listing 'playwright_get' among API request tools, used for conditional context setup.
    export const API_TOOLS = [
      "playwright_get",
      "playwright_post",
      "playwright_put",
      "playwright_delete",
      "playwright_patch",
    ];
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states what the tool does but reveals nothing about behavioral traits: no mention of error handling, timeout behavior, response format, authentication needs, rate limits, or side effects. For an HTTP tool with zero annotation coverage, this leaves critical operational details unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely conciseโ€”a single sentence with zero wasted words. It's front-loaded with the core action and resource. Every word earns its place, making it efficient for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of HTTP operations and the lack of both annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., response body, status code, headers) or any behavioral expectations. For a tool that likely interacts with web resources, this leaves too many unknowns for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'url' fully documented in the schema. The description adds no additional parameter semantics beyond what's already in the structured data. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Perform an HTTP GET request') and the resource (HTTP endpoint via URL), making the purpose immediately understandable. It doesn't explicitly distinguish from sibling tools like playwright_post or playwright_navigate, but the verb 'GET' is specific enough to imply basic HTTP semantics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like playwright_navigate (for page navigation) and playwright_post (for POST requests), there's no indication of when GET is appropriate versus other HTTP methods or navigation approaches. The description is purely functional without contextual usage advice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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