browser_refresh
Refresh the current web page in the browser to reload content, update dynamic elements, or resolve display issues during automated testing.
Instructions
Refresh the current page
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/browserTools.ts:215-232 (handler)The handler function for the 'browser_refresh' tool. It retrieves the current WebDriver instance from the state manager and calls `navigate().refresh()` to refresh the current page, returning a success or error message.
server.tool('browser_refresh', 'Refresh the current page', {}, async () => { try { const driver = stateManager.getDriver(); await driver.navigate().refresh(); return { content: [{ type: 'text', text: `Browser refreshed` }], }; } catch (e) { return { content: [ { type: 'text', text: `Error refreshing browser: ${(e as Error).message}`, }, ], }; } }); - src/tools/browserTools.ts:215-232 (registration)Registration of the 'browser_refresh' tool on the MCP server using `server.tool()`, with no input schema required.
server.tool('browser_refresh', 'Refresh the current page', {}, async () => { try { const driver = stateManager.getDriver(); await driver.navigate().refresh(); return { content: [{ type: 'text', text: `Browser refreshed` }], }; } catch (e) { return { content: [ { type: 'text', text: `Error refreshing browser: ${(e as Error).message}`, }, ], }; } }); - src/tools/index.ts:9-9 (registration)Call to registerBrowserTools within the registerAllTools function, which registers all browser tools including 'browser_refresh'.
registerBrowserTools(server, stateManager);