Skip to main content
Glama

new_page

Open a new browser tab and navigate to a specified URL for testing, scraping, or browser automation tasks. Returns the tab index for further interaction.

Instructions

Open a new tab and navigate it to the provided URL. Returns the new tab index in the response.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to load in a new page

Implementation Reference

  • The main handler function that implements the 'new_page' tool logic: validates the URL argument, obtains Firefox instance, calls createNewPage, and returns success response with new tab index.
    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); } }
  • The schema definition for the 'new_page' tool, specifying name, description, and inputSchema requiring a 'url' string.
    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 page tools handlers including 'new_page' in the central toolHandlers Map used by the MCP server.
    // Pages ['list_pages', tools.handleListPages], ['new_page', tools.handleNewPage], ['navigate_page', tools.handleNavigatePage], ['select_page', tools.handleSelectPage], ['close_page', tools.handleClosePage],
  • src/index.ts:151-156 (registration)
    Inclusion of newPageTool schema in the allTools array provided to the MCP server via listTools.
    // Pages tools.listPagesTool, tools.newPageTool, tools.navigatePageTool, tools.selectPageTool, tools.closePageTool,

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

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