Skip to main content
Glama

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
NameRequiredDescriptionDefault
instanceIdYesInstance ID

Implementation Reference

  • 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']
      }
    },
  • The input schema for browser_refresh tool, defining the required instanceId parameter.
    inputSchema: {
      type: 'object',
      properties: {
        instanceId: {
          type: 'string',
          description: 'Instance ID'
        }
      },
      required: ['instanceId']
    }
  • The switch case in executeTools that dispatches to the refresh handler for browser_refresh.
    case 'browser_refresh':
      return await this.refresh(args.instanceId);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sailaoda/concurrent-browser-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server