Skip to main content
Glama

playwright_navigate

Direct a browser to a specified URL using Playwright automation, enabling web page interaction, content retrieval, and testing within an automated environment.

Instructions

Navigate to a URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes

Implementation Reference

  • The core handler logic for the 'playwright_navigate' tool. It navigates the Playwright page to the specified URL with optional timeout and waitUntil options, returning success or error message.
    case "playwright_navigate":
      try {
        await page!.goto(args.url, {
          timeout: args.timeout || 30000,
          waitUntil: args.waitUntil || "load"
        });
        return {
          toolResult: {
            content: [{
              type: "text",
              text: `Navigated to ${args.url} with ${args.waitUntil || "load"} wait`,
            }],
            isError: false,
          },
        };
      } catch (error) {
        return {
          toolResult: {
            content: [{
              type: "text",
              text: `Navigation failed: ${(error as Error).message}`,
            }],
            isError: true,
          },
        };
      }
  • The tool schema definition for 'playwright_navigate', including name, description, and input schema requiring a 'url' string.
    {
      name: "playwright_navigate",
      description: "Navigate to a URL",
      inputSchema: {
        type: "object",
        properties: {
          url: { type: "string" },
        },
        required: ["url"],
      },
    },
  • Registration of the MCP CallTool request handler, which routes tool calls (including 'playwright_navigate') to the handleToolCall function in toolsHandler.ts.
    // Call tool handler
    server.setRequestHandler(CallToolRequestSchema, async (request) =>
      handleToolCall(request.params.name, request.params.arguments ?? {}, server)
    );
  • Registration of the MCP ListTools request handler, which provides the list of available tools including 'playwright_navigate'.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: tools,
    }));
  • Helper function to ensure the Playwright browser and page are launched, used by browser-requiring tools like 'playwright_navigate'.
    async function ensureBrowser() {
      if (!browser) {
        browser = await chromium.launch({ headless: false });
        const context = await browser.newContext({
          viewport: { width: 1920, height: 1080 },
          deviceScaleFactor: 1,
        });
    
        page = await context.newPage();
    
        page.on("console", (msg) => {
          const logEntry = `[${msg.type()}] ${msg.text()}`;
          consoleLogs.push(logEntry);
          // Note: server.notification is assumed to be passed in from the main server
        });
      }
      return page!;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Navigate to a URL' but doesn't explain what this entails—e.g., whether it opens a browser, loads a page, handles redirects, requires authentication, or has side effects like network requests. This lack of detail makes it inadequate for understanding the tool's behavior beyond the basic action.

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. Every part of the sentence directly contributes to the purpose, making it efficient and well-structured for its brevity.

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 tool's complexity (likely involves browser interaction), lack of annotations, no output schema, and minimal parameter documentation, the description is incomplete. It doesn't cover what happens after navigation (e.g., page load, errors, return values) or prerequisites, leaving significant gaps for an agent to use it effectively.

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

Parameters2/5

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

The input schema has 1 parameter with 0% description coverage, so the schema provides no details about 'url'. The description adds no meaning beyond implying a URL is needed—it doesn't specify format (e.g., must be valid HTTP/HTTPS), constraints, or examples. This fails to compensate for the low schema coverage, leaving the parameter poorly documented.

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 (URL), making the basic purpose understandable. However, it lacks specificity about what 'navigate' entails (e.g., browser navigation vs. API navigation) and doesn't distinguish it from siblings like 'playwright_get' which might have overlapping functionality. This makes it vague rather than precise.

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?

No guidance is provided on when to use this tool versus alternatives. Given sibling tools like 'playwright_get' (which might retrieve content) and 'playwright_post' (which might send data), the description offers no context for selection. This leaves the agent without explicit or implied usage instructions.

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

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

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