browser_get_url
Retrieve the current webpage URL during browser automation to track navigation progress or verify page location.
Instructions
Get the current page URL
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/browserTools.ts:126-143 (handler)Registers and implements the 'browser_get_url' tool. Retrieves the current browser session driver from the StateManager, calls getCurrentUrl() on it, and formats the result as an MCP tool response with error handling.server.tool('browser_get_url', 'Get the current page URL', {}, async () => { try { const driver = stateManager.getDriver(); const url = await driver.getCurrentUrl(); return { content: [{ type: 'text', text: `Current page URL is: ${url}` }], }; } catch (e) { return { content: [ { type: 'text', text: `Error getting page URL: ${(e as Error).message}`, }, ], }; } });