Skip to main content
Glama

rescan_elements

Rescan UI elements on a web page after content changes like navigation or DOM updates to maintain accurate annotations.

Instructions

Force the annotated page to rescan all UI elements. Use this after the page content has changed (e.g. after navigation, DOM updates, or user interaction).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for the 'rescan_elements' tool, which triggers a rescan command via the proxy and waits for elements to be updated.
    mcp.tool(
      'rescan_elements',
      'Force the annotated page to rescan all UI elements. Use this after the page content has changed (e.g. after navigation, DOM updates, or user interaction).',
      {},
      async () => {
        proxy.rescan();
        // Wait a moment for the scan to complete
        await new Promise(r => setTimeout(r, 500));
        const count = proxy.getElements().length;
        return {
          content: [{
            type: 'text',
            text: `Rescanned page. Found ${count} elements.`,
          }],
        };
      }
  • The implementation of the rescan action, which adds a 'scan' command to the pending commands queue for the browser to execute.
    rescan: () => { pendingCommands.push({ type: 'scan' }); },

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/mcpware/ui-annotator-mcp'

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