Skip to main content
Glama

navigate

Go to a specified URL with an option to wait for full page load, enabling browser navigation for web automation and content retrieval.

Instructions

Navigate to a URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to navigate to
waitForLoadNoWait for page to fully load

Implementation Reference

  • Zod schema for the 'navigate' tool: validates url (string that must be a valid URL) and optional waitForLoad (boolean, defaults to true).
    const NavigateSchema = z.object({
      url: z.string().url(),
      waitForLoad: z.boolean().default(true)
    });
  • src/index.ts:127-404 (registration)
    Tool registration inside setupToolHandlers(). The 'navigate' tool is registered in the ListToolsRequestSchema handler (lines 158-176) with name 'navigate', description 'Navigate to a URL', and inputSchema defining url (required string) and waitForLoad (optional boolean with default true).
    private setupToolHandlers() {
      this.server.setRequestHandler(ListToolsRequestSchema, async () => {
        return {
          tools: [
            {
              name: 'launch_browser',
              description: 'Launch a new browser instance (chromium, firefox, or webkit)',
              inputSchema: {
                type: 'object',
                properties: {
                  browser: {
                    type: 'string',
                    enum: ['chromium', 'firefox', 'webkit'],
                    default: 'chromium',
                    description: 'Browser engine to use'
                  },
                  headless: {
                    type: 'boolean',
                    default: true,
                    description: 'Run browser in headless mode'
                  },
                  viewport: {
                    type: 'object',
                    properties: {
                      width: { type: 'number', default: 1280 },
                      height: { type: 'number', default: 720 }
                    }
                  }
                }
              }
            },
            {
              name: 'navigate',
              description: 'Navigate to a URL',
              inputSchema: {
                type: 'object',
                properties: {
                  url: {
                    type: 'string',
                    description: 'URL to navigate to'
                  },
                  waitForLoad: {
                    type: 'boolean',
                    default: true,
                    description: 'Wait for page to fully load'
                  }
                },
                required: ['url']
              }
            },
            {
              name: 'click_element',
              description: 'Click on an element by CSS selector',
              inputSchema: {
                type: 'object',
                properties: {
                  selector: {
                    type: 'string',
                    description: 'CSS selector for the element to click'
                  },
                  timeout: {
                    type: 'number',
                    default: 5000,
                    description: 'Timeout in milliseconds'
                  }
                },
                required: ['selector']
              }
            },
            {
              name: 'type_text',
              description: 'Type text into an input field',
              inputSchema: {
                type: 'object',
                properties: {
                  selector: {
                    type: 'string',
                    description: 'CSS selector for the input element'
                  },
                  text: {
                    type: 'string',
                    description: 'Text to type'
                  },
                  delay: {
                    type: 'number',
                    default: 100,
                    description: 'Delay between keystrokes in milliseconds'
                  }
                },
                required: ['selector', 'text']
              }
            },
            {
              name: 'screenshot',
              description: 'Take a screenshot of the current page',
              inputSchema: {
                type: 'object',
                properties: {
                  fullPage: {
                    type: 'boolean',
                    default: false,
                    description: 'Capture full scrollable page'
                  },
                  path: {
                    type: 'string',
                    description: 'Path to save screenshot (optional)'
                  }
                }
              }
            },
            {
              name: 'get_element_text',
              description: 'Get text content of an element',
              inputSchema: {
                type: 'object',
                properties: {
                  selector: {
                    type: 'string',
                    description: 'CSS selector for the element'
                  },
                  timeout: {
                    type: 'number',
                    default: 5000,
                    description: 'Timeout in milliseconds'
                  }
                },
                required: ['selector']
              }
            },
            {
              name: 'wait_for_element',
              description: 'Wait for an element to appear or disappear',
              inputSchema: {
                type: 'object',
                properties: {
                  selector: {
                    type: 'string',
                    description: 'CSS selector for the element'
                  },
                  timeout: {
                    type: 'number',
                    default: 30000,
                    description: 'Timeout in milliseconds'
                  },
                  state: {
                    type: 'string',
                    enum: ['attached', 'detached', 'visible', 'hidden'],
                    default: 'visible',
                    description: 'State to wait for'
                  }
                },
                required: ['selector']
              }
            },
            {
              name: 'evaluate_javascript',
              description: 'Execute JavaScript in the browser context',
              inputSchema: {
                type: 'object',
                properties: {
                  script: {
                    type: 'string',
                    description: 'JavaScript code to execute'
                  }
                },
                required: ['script']
              }
            },
            {
              name: 'get_console_logs',
              description: 'Get console logs from the browser',
              inputSchema: {
                type: 'object',
                properties: {
                  level: {
                    type: 'string',
                    enum: ['log', 'info', 'warn', 'error', 'debug'],
                    description: 'Filter logs by level'
                  },
                  clear: {
                    type: 'boolean',
                    default: false,
                    description: 'Clear console logs after retrieving'
                  }
                }
              }
            },
            {
              name: 'get_page_info',
              description: 'Get information about the current page',
              inputSchema: {
                type: 'object',
                properties: {}
              }
            },
            {
              name: 'close_browser',
              description: 'Close the current browser instance',
              inputSchema: {
                type: 'object',
                properties: {}
              }
            },
            {
              name: 'analyze_screenshot',
              description: 'Take a screenshot and analyze it with AI (Gemma3) to describe what is visible on the page',
              inputSchema: {
                type: 'object',
                properties: {
                  fullPage: {
                    type: 'boolean',
                    default: false,
                    description: 'Capture full scrollable page'
                  },
                  path: {
                    type: 'string',
                    description: 'Path to save screenshot (optional)'
                  },
                  pretext: {
                    type: 'string',
                    description: 'Optional context or specific instructions for what to look for in the analysis'
                  },
                  model: {
                    type: 'string',
                    default: 'gemma3:4b',
                    description: 'AI model to use for analysis (default: gemma3:4b)'
                  },
                  detailed: {
                    type: 'boolean',
                    default: false,
                    description: 'Provide detailed structural analysis of the page'
                  }
                }
              }
            },
            {
              name: 'scroll',
              description: 'Scroll the page in the specified direction',
              inputSchema: {
                type: 'object',
                properties: {
                  direction: {
                    type: 'string',
                    enum: ['up', 'down', 'left', 'right'],
                    default: 'down',
                    description: 'Direction to scroll'
                  },
                  pixels: {
                    type: 'number',
                    description: 'Number of pixels to scroll (optional)'
                  },
                  behavior: {
                    type: 'string',
                    enum: ['auto', 'smooth'],
                    default: 'auto',
                    description: 'Scrolling behavior'
                  }
                }
              }
            },
            {
              name: 'check_scrollability',
              description: 'Check if the page is scrollable in the specified direction',
              inputSchema: {
                type: 'object',
                properties: {
                  direction: {
                    type: 'string',
                    enum: ['vertical', 'horizontal', 'both'],
                    default: 'both',
                    description: 'Direction to check for scrollability'
                  }
                }
              }
            }
          ],
        };
      });
  • The actual handler for the 'navigate' tool inside the CallToolRequestSchema handler. It parses args using NavigateSchema, navigates currentPage to the URL (with optional waitUntil:'networkidle' if waitForLoad is true), gets the page title, and returns a text response with the navigation result and page title.
    case 'navigate': {
      if (!currentPage) {
        throw new Error('No browser page available. Launch a browser first.');
      }
    
      const params = NavigateSchema.parse(args);
      
      if (params.waitForLoad) {
        await currentPage.goto(params.url, { waitUntil: 'networkidle' });
      } else {
        await currentPage.goto(params.url);
      }
    
      const title = await currentPage.title();
      
      return {
        content: [
          {
            type: 'text',
            text: `Navigated to ${params.url}\nPage title: ${title}`
          }
        ]
      };
    }
Behavior2/5

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

With no annotations, the description should disclose behavioral traits. It does not mention whether navigation occurs in the same tab, requires a prior launch_browser, or any side effects like clearing the page state.

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

Conciseness3/5

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

The description is very concise with a single phrase, but it is too terse. It sacrifices informativeness for 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 no output schema, the description should explain the outcome of navigation (e.g., new page loaded, previous state). It fails to do so, leaving the agent without essential context.

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 coverage is 100%, providing clear descriptions for both parameters. The tool description adds no additional meaning beyond what the schema already offers.

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 (Navigate) and resource (a URL). It is unambiguous among siblings, though it does not explicitly differentiate from similar tools like click_element that might also change the URL.

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 on when to use navigate versus alternatives such as clicking links or launching the browser first. The description lacks context for proper usage.

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/Wladastic/mcp-browser-server'

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