Skip to main content
Glama

navigate_page

Directs the browser tab to load a specific web address for testing, automation, or navigation tasks.

Instructions

Navigate the currently selected tab to the provided URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to navigate the page to

Implementation Reference

  • The handler function that executes the navigate_page tool logic. It validates the URL input, gets the Firefox instance, navigates the selected tab to the given URL, and returns a success response with the tab index.
    export async function handleNavigatePage(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(); // Refresh tabs to get latest list await firefox.refreshTabs(); const tabs = firefox.getTabs(); const selectedIdx = firefox.getSelectedTabIdx(); const page = tabs[selectedIdx]; if (!page) { throw new Error('No page selected'); } await firefox.navigate(url); return successResponse(`✅ [${selectedIdx}] → ${url}`); } catch (error) { return errorResponse(error as Error); } }
  • The tool schema definition including name, description, and input schema requiring a 'url' string parameter.
    export const navigatePageTool = { name: 'navigate_page', description: 'Navigate selected tab to URL.', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'Target URL', }, }, required: ['url'], }, };
  • src/index.ts:110-110 (registration)
    Registration of the navigate_page handler in the toolHandlers Map, mapping the tool name to its handler function.
    ['navigate_page', tools.handleNavigatePage],
  • src/index.ts:154-154 (registration)
    Inclusion of the navigate_page tool definition in the allTools array used for listing available tools.
    tools.navigatePageTool,
  • Re-export of navigatePageTool and handleNavigatePage from pages.js, making them available centrally in tools/index.ts.
    export { listPagesTool, newPageTool, navigatePageTool, selectPageTool, closePageTool, handleListPages, handleNewPage, handleNavigatePage, handleSelectPage, handleClosePage, } from './pages.js';

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