Skip to main content
Glama

new_page

Open a new browser tab at a specified URL for automated testing, web scraping, or browser control tasks.

Instructions

Open new tab at URL. Returns tab index.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesTarget URL

Implementation Reference

  • Main handler function for the 'new_page' MCP tool. Parses arguments, validates URL input, initializes Firefox instance if needed, calls firefox.createNewPage(url), and returns a formatted success response or error.
    export async function handleNewPage(args: unknown): Promise<McpToolResponse> {
      try {
        const { url } = args as { url: string };
    
        if (!url || typeof url !== 'string') {
          throw new Error('url parameter is required and must be a string');
        }
    
        const { getFirefox } = await import('../index.js');
        const firefox = await getFirefox();
    
        const newIdx = await firefox.createNewPage(url);
    
        return successResponse(`✅ new page [${newIdx}] → ${url}`);
      } catch (error) {
        return errorResponse(error as Error);
      }
    }
  • Tool schema definition for 'new_page', including name, description, and inputSchema requiring a 'url' string parameter.
    export const newPageTool = {
      name: 'new_page',
      description: 'Open new tab at URL. Returns tab index.',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: 'Target URL',
          },
        },
        required: ['url'],
      },
    };
  • src/index.ts:107-112 (registration)
    Registration of 'new_page' handler in the central toolHandlers Map used by the MCP server to dispatch tool calls.
    // Pages
    ['list_pages', tools.handleListPages],
    ['new_page', tools.handleNewPage],
    ['navigate_page', tools.handleNavigatePage],
    ['select_page', tools.handleSelectPage],
    ['close_page', tools.handleClosePage],
  • src/index.ts:152-156 (registration)
    Registration of 'new_page' schema in the allTools array returned by listTools MCP request.
    tools.listPagesTool,
    tools.newPageTool,
    tools.navigatePageTool,
    tools.selectPageTool,
    tools.closePageTool,
  • Core implementation of createNewPage using WebDriver BiDi: opens new tab, switches to it, navigates to URL, updates cache, returns new tab index. Called by the tool handler via FirefoxDevTools facade.
    async createNewPage(url: string): Promise<number> {
      await this.driver.switchTo().newWindow('tab');
      const handles = await this.driver.getAllWindowHandles();
      const newIdx = handles.length - 1;
      this.setCurrentContextId(handles[newIdx]!);
      this.cachedSelectedIdx = newIdx;
      await this.driver.get(url);
      return newIdx;
    }
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. It mentions the action ('Open new tab') and return value ('Returns tab index'), but lacks critical behavioral details: it doesn't specify if this requires specific permissions, how it handles invalid URLs, whether it waits for page load, or potential side effects like browser focus changes. For a tool with no annotation coverage, this is insufficient.

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 and front-loaded, consisting of two short sentences that directly state the purpose and outcome. Every word earns its place, with no redundant or vague phrasing, making it efficient and 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 tool's complexity (a mutation that opens new tabs) and the absence of annotations and output schema, the description is incomplete. It doesn't explain the return value's format (e.g., what 'tab index' means or how to use it), error conditions, or integration with sibling tools like 'select_page'. This leaves significant gaps for an AI agent to use it correctly.

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 parameter 'url' fully documented in the schema as 'Target URL'. The description adds no additional meaning beyond this, such as URL format requirements or examples. With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't detract.

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 ('Open new tab') and resource ('at URL'), with a specific verb and target. It distinguishes from siblings like 'navigate_page' (which likely navigates an existing tab) by specifying it creates a new tab. However, it doesn't explicitly contrast with all siblings, keeping it at 4 rather than 5.

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 doesn't mention when to choose 'new_page' over 'navigate_page' (for existing tabs) or 'list_pages' (to check current tabs), nor does it specify prerequisites like needing an open browser context. This lack of contextual guidance limits its utility.

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/mozilla/firefox-devtools-mcp'

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