Skip to main content
Glama
BrowserGenie

BrowserGenie MCP Server

by BrowserGenie

navigate_to_url

Load any web page by navigating to a specified URL. Automatically waits for the page to finish loading.

Instructions

Load a web page in the browser. Use this whenever you need to go to a specific website or web address. Automatically waits for page to load.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesFull URL including http:// or https:// (e.g., "https://google.com")
tabIdNoTarget tab ID (defaults to currently active tab)
apiKeyNoAPI key for authentication if enabled

Implementation Reference

  • Handler function for the 'navigate_to_url' tool. Sends a 'navigate_to_url' command via WebSocket bridge, waits for response, and returns success/error text content.
      async ({ url, tabId, apiKey }) => {
        const result = await bridge.sendCommand({
          command: 'navigate_to_url',
          params: { url },
          tabId,
          apiKey,
          timeout: LONG_TIMEOUT,
        });
        if (!result.success) {
          return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true };
        }
        return { content: [{ type: 'text', text: `Navigated to ${url}` }] };
      }
    );
  • Schema (Zod) definitions for navigate_to_url input: url (required string), tabId (optional number), apiKey (optional string).
    {
      url: z.string().describe('Full URL including http:// or https:// (e.g., "https://google.com")'),
      tabId: z.number().optional().describe('Target tab ID (defaults to currently active tab)'),
      apiKey: z.string().optional().describe('API key for authentication if enabled'),
    },
  • Registration of navigate_to_url tool via server.tool() within the registerNavigationTools function, aggregated into registerAllTools in tools/index.ts.
    export function registerNavigationTools(server: McpServer, bridge: WebSocketBridge) {
      server.tool(
        'navigate_to_url',
        'Load a web page in the browser. Use this whenever you need to go to a specific website or web address. Automatically waits for page to load.',
        {
          url: z.string().describe('Full URL including http:// or https:// (e.g., "https://google.com")'),
          tabId: z.number().optional().describe('Target tab ID (defaults to currently active tab)'),
          apiKey: z.string().optional().describe('API key for authentication if enabled'),
        },
        async ({ url, tabId, apiKey }) => {
          const result = await bridge.sendCommand({
            command: 'navigate_to_url',
            params: { url },
            tabId,
            apiKey,
            timeout: LONG_TIMEOUT,
          });
          if (!result.success) {
            return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true };
          }
          return { content: [{ type: 'text', text: `Navigated to ${url}` }] };
        }
      );
  • WebSocketBridge.sendCommand() helper used by the handler to send the command and await the response.
    async sendCommand(cmd: BridgeCommand): Promise<BridgeResponse> {
      if (!this.isConnected()) {
        return {
          success: false,
          error: {
            code: 'NOT_CONNECTED',
            message: 'Chrome extension is not connected. Ensure the extension is installed, enabled, and the browser is running.',
          },
        };
      }
    
      const id = crypto.randomUUID();
      const timeout = cmd.timeout ?? DEFAULT_TIMEOUT;
    
      return new Promise<BridgeResponse>((resolve, reject) => {
        const timer = setTimeout(() => {
          this.pending.delete(id);
          resolve({
            success: false,
            error: {
              code: 'TIMEOUT',
              message: `Command '${cmd.command}' timed out after ${timeout}ms`,
            },
          });
        }, timeout);
    
        this.pending.set(id, { resolve, reject, timer });
    
        const message = {
          id,
          type: 'request',
          command: cmd.command,
          params: cmd.params,
          tabId: cmd.tabId,
          apiKey: cmd.apiKey,
          timestamp: Date.now(),
        };
    
        this.client!.send(JSON.stringify(message));
      });
    }
  • TypeScript interfaces (BridgeCommand, BridgeResponse) and LONG_TIMEOUT constant used by the navigate_to_url handler.
    export interface BridgeCommand {
      command: string;
      params: Record<string, unknown>;
      tabId?: number;
      apiKey?: string;
      timeout?: number;
    }
    
    export interface BridgeResponse {
      success: boolean;
      data?: unknown;
      error?: {
        code: string;
        message: string;
      };
    }
    
    export interface PendingRequest {
      resolve: (value: BridgeResponse) => void;
      reject: (error: Error) => void;
      timer: ReturnType<typeof setTimeout>;
    }
    
    export const DEFAULT_TIMEOUT = 30_000;
    export const LONG_TIMEOUT = 60_000;
    export const WEBSOCKET_PORT = parseInt(process.env.WEBSOCKET_PORT || '7890', 10);
Behavior3/5

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

The description adds one behavioral detail: 'Automatically waits for page to load'. No annotations exist, so the description carries the burden. However, it does not disclose error behavior, authentication needs, or side effects (e.g., tab switching).

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?

Two concise sentences with no redundancy. Each sentence adds value: the first states the purpose, the second adds a behavioral trait. No wasted words.

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

Completeness4/5

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

The tool is simple (navigate to URL), and the description covers the core action and a key behavior (auto-wait). However, it lacks information about the return value (e.g., success/failure or page title) and does not integrate with sibling differentiation.

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 covers all three parameters with descriptions (100% coverage). The description only mentions 'URL' but does not add meaning beyond the schema. Baseline of 3 is appropriate.

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 verb 'load' and resource 'web page', and specifies the use case for navigating to a URL. However, it does not differentiate from sibling tools like navigate_back or navigate_forward.

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

Usage Guidelines3/5

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

It provides a clear when-to-use scenario ('whenever you need to go to a specific website'), but lacks any alternatives or when-not-to-use guidance. Given the many navigation-related siblings, this is a gap.

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/BrowserGenie/mcp'

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