browser_refresh
Refresh the current page in a browser instance to reload content and resolve display issues.
Instructions
Refresh the current page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instanceId | Yes | Instance ID |
Implementation Reference
- src/tools.ts:672-692 (handler)The handler function for the browser_refresh tool. It retrieves the browser instance, reloads the current page using page.reload(), and returns success with the new URL or an error.private async refresh(instanceId: string): Promise<ToolResult> { const instance = this.browserManager.getInstance(instanceId); if (!instance) { return { success: false, error: `Instance ${instanceId} not found` }; } try { await instance.page.reload(); return { success: true, data: { url: instance.page.url() }, instanceId }; } catch (error) { return { success: false, error: `Refresh failed: ${error instanceof Error ? error.message : error}`, instanceId }; } }
- src/tools.ts:150-163 (registration)The registration of the browser_refresh tool in the getTools() method, including name, description, and input schema requiring instanceId.{ name: 'browser_refresh', description: 'Refresh the current page', inputSchema: { type: 'object', properties: { instanceId: { type: 'string', description: 'Instance ID' } }, required: ['instanceId'] } },
- src/tools.ts:153-162 (schema)The input schema for browser_refresh tool, defining the required instanceId parameter.inputSchema: { type: 'object', properties: { instanceId: { type: 'string', description: 'Instance ID' } }, required: ['instanceId'] }
- src/tools.ts:530-531 (handler)The switch case in executeTools that dispatches to the refresh handler for browser_refresh.case 'browser_refresh': return await this.refresh(args.instanceId);