Skip to main content
Glama

playwright_navigate

Navigate to a specified URL in a browser with configurable viewport settings, timeout, and wait conditions for web automation tasks.

Instructions

Navigate to a URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
widthNoViewport width in pixels (default: 1920)
heightNoViewport height in pixels (default: 1080)
timeoutNoNavigation timeout in milliseconds
waitUntilNoNavigation wait condition

Implementation Reference

  • Handler function for the playwright_navigate tool, performs page navigation using Playwright's goto method.
    case "playwright_navigate":
      try {
        await page!.goto(args.url, {
          timeout: args.timeout || 30000,
          waitUntil: args.waitUntil || "load"
        });
        return {
          content: [{
            type: "text",
            text: `Navigated to ${args.url}`,
          }],
          isError: false,
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: `Navigation failed: ${(error as Error).message}`,
          }],
          isError: true,
        };
      }
  • Input schema definition for the playwright_navigate tool, specifying parameters like url, viewport size, timeout, and waitUntil.
    {
      name: "playwright_navigate",
      description: "Navigate to a URL",
      inputSchema: {
        type: "object",
        properties: {
          url: { type: "string" },
          width: { type: "number", description: "Viewport width in pixels (default: 1920)" },
          height: { type: "number", description: "Viewport height in pixels (default: 1080)" },
          timeout: { type: "number", description: "Navigation timeout in milliseconds" },
          waitUntil: { type: "string", description: "Navigation wait condition" }
        },
        required: ["url"],
      },
    },
  • Registers the list tools request handler, which returns the array of tool definitions including playwright_navigate.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: tools,
    }));
  • Registers the call tool request handler, which dispatches to the specific tool handler based on name, including playwright_navigate.
    server.setRequestHandler(CallToolRequestSchema, async (request) =>
      handleToolCall(request.params.name, request.params.arguments ?? {}, server)
    );
  • Helper array listing browser-requiring tools, including playwright_navigate, used to conditionally launch the browser.
    export const BROWSER_TOOLS = [
      "playwright_navigate",
      "playwright_screenshot",
      "playwright_click",
      "playwright_fill",
      "playwright_select",
      "playwright_hover",
      "playwright_evaluate"
    ];
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Navigate to a URL' implies a navigation action but does not disclose key traits like whether it loads a page in a browser, handles redirects, requires network connectivity, or has side effects (e.g., changing browser state). This leaves significant gaps in understanding the tool's behavior.

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 with a single sentence, 'Navigate to a URL', which is front-loaded and wastes no words. It efficiently conveys the core action without unnecessary elaboration, making it easy to parse.

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 a navigation tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It lacks information on what the tool returns (e.g., page content, status), error handling, or how it integrates with other playwright tools, leaving the agent with insufficient context for effective 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?

The input schema has 80% description coverage, providing details for parameters like width, height, timeout, and waitUntil. The description does not add meaning beyond the schema, as it only mentions 'a URL' without explaining parameter usage or interactions. With high schema coverage, the baseline is 3, but the description does not compensate for the 20% gap (e.g., explaining the 'url' parameter further).

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

Purpose3/5

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

The description 'Navigate to a URL' clearly states the action (navigate) and target (a URL), which is a specific verb+resource. However, it does not distinguish this tool from its siblings like 'playwright_get' or 'playwright_post', which might also involve navigation or URL interactions, leaving the purpose somewhat vague in context.

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. It does not mention any context, prerequisites, or exclusions, such as how it differs from other playwright tools like 'playwright_get' for HTTP requests or 'playwright_screenshot' for capturing pages after navigation.

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/lars-hagen/mcp-playwright-cdp'

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