browser_title
Retrieve the current webpage title to verify page navigation, confirm page identity, or extract page information during automated browser testing and interaction.
Instructions
Get the current page title
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/browserTools.ts:107-124 (handler)The handler for the 'browser_title' tool. It retrieves the active browser driver from the StateManager, fetches the current page title using driver.getTitle(), and returns it in the MCP response format. Includes try-catch for error handling.server.tool('browser_title', 'Get the current page title', {}, async () => { try { const driver = stateManager.getDriver(); const title = await driver.getTitle(); return { content: [{ type: 'text', text: `Current page title is: ${title}` }], }; } catch (e) { return { content: [ { type: 'text', text: `Error getting page title: ${(e as Error).message}`, }, ], }; } });
- src/tools/index.ts:9-9 (registration)Invocation of registerBrowserTools within the registerAllTools function, which registers the browser_title tool among other browser tools.registerBrowserTools(server, stateManager);