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' }); },
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the tool's action ('force... rescan') and triggers for use, but lacks details on behavioral traits like side effects (e.g., performance impact), permissions needed, or response format. It's adequate but has clear gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It's appropriately sized with two sentences: the first states the purpose, and the second provides usage guidelines. Every sentence adds value without waste, and it's front-loaded with the core action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation with no output schema and no annotations), the description is minimally viable. It covers purpose and usage but lacks details on behavioral traits or output, leaving gaps that could hinder an agent's understanding of the full context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description doesn't add param info, which is appropriate, earning a baseline score above 3 due to the absence of parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('rescan') and resource ('all UI elements'), and distinguishes it from siblings by specifying it's for 'the annotated page' after content changes, unlike get_elements (likely for retrieval) or highlight_element (likely for visualization).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states when to use this tool ('after the page content has changed') with concrete examples (e.g., navigation, DOM updates, user interaction), and implies when not to use it (when content is static), though it doesn't name specific alternatives among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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