browser_title
Retrieve the current web page title during browser automation to verify page loading or extract page information.
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 inline handler function for the 'browser_title' tool. It retrieves the current browser driver from the state manager, fetches the page title using driver.getTitle(), and returns it in the MCP response format, with 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/browserTools.ts:107-124 (registration)Registration of the 'browser_title' tool using server.tool, with no input schema ({}), description 'Get the current page title', and inline handler.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}`, }, ], }; } });