Skip to main content
Glama
FutureAtoms

Agentic Control Framework (ACF)

by FutureAtoms

browser_wait_for

Pauses browser automation until a page condition is met. Use to synchronize actions with page loading or changes.

Instructions

browser wait for

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The browserWaitFor function that implements the 'browser_wait_for' tool logic. It waits for text to appear (options.text), for text to disappear (options.textGone), or for a specified time (options.time) using Playwright's page.waitForSelector and page.waitForTimeout.
    async function browserWaitFor(options = {}) {
      try {
        const page = await getPage();
        
        if (options.text) {
          // Wait for text to appear
          await page.waitForSelector(`text=${options.text}`, {
            timeout: config.timeout
          });
          
          return {
            success: true,
            message: `Found text: ${options.text}`
          };
        } else if (options.textGone) {
          // Wait for text to disappear
          await page.waitForSelector(`text=${options.textGone}`, {
            state: 'hidden',
            timeout: config.timeout
          });
          
          return {
            success: true,
            message: `Text disappeared: ${options.textGone}`
          };
        } else if (options.time) {
          // Wait for specified time
          const waitTime = Math.min(options.time, 10) * 1000;
          await page.waitForTimeout(waitTime);
          
          return {
            success: true,
            message: `Waited for ${waitTime / 1000} seconds`
          };
        } else {
          return {
            success: false,
            message: 'Must specify text, textGone, or time to wait for'
          };
        }
    
      } catch (error) {
        logger.error(`Error waiting: ${error.message}`);
        return {
          success: false,
          message: error.message
        };
      }
    }
  • The MCP server routes 'browser_wait_for' tool calls to browserTools.browserWaitFor with text, textGone, and time arguments.
    case 'browser_wait_for': data = await browserTools.browserWaitFor({ text: args.text, textGone: args.textGone, time: args.time }); break;
  • The 'browser_wait_for' tool is registered in the extended browser tool schemas list sent via tools/list, with an empty inputSchema.
      { n:'browser_navigate_back' }, { n:'browser_navigate_forward' }, { n:'browser_hover' }, { n:'browser_drag' },
      { n:'browser_select_option' }, { n:'browser_press_key' }, { n:'browser_snapshot' }, { n:'browser_console_messages' },
      { n:'browser_network_requests' }, { n:'browser_tab_list' }, { n:'browser_tab_new' }, { n:'browser_tab_select' },
      { n:'browser_tab_close' }, { n:'browser_file_upload' }, { n:'browser_wait' }, { n:'browser_wait_for' },
      { n:'browser_resize' }, { n:'browser_handle_dialog' }
    ];
    for (const b of browserExtras) {
      tools.push({ name: b.n, description: b.n.replace(/_/g,' '), inputSchema: { type:'object', properties:{} } });
    }
  • browserWaitFor is exported from the browser_tools module, making it available for the MCP server to call.
    browserWaitFor,
Behavior1/5

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

No annotations provided, and description fails to disclose any behavioral traits (e.g., what triggers the wait, timeout behavior, side effects). Adds no value beyond tool name.

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

Conciseness2/5

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

Extremely short (4 words), but under-specified; not concise in a helpful way. Flunks the test of earning its place with useful information.

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

Completeness1/5

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

Given 0 parameters and no output schema, description still must explain the tool's purpose. It fails entirely to convey what 'browser wait for' does, making it useless for an agent.

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

Parameters1/5

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

Input schema has 0 parameters, so baseline is 4, but description does not add any meaning or clarify the tool's behavior. Fails to explain what the tool does.

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

Purpose1/5

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

Description is a tautology ('browser wait for'), restating the name without specifying action. Does not indicate what condition or event the tool waits for, distinguishing it from sibling 'browser_wait'.

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

Usage Guidelines1/5

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

No guidance on when to use this tool versus alternatives like 'browser_wait' or other browser actions. Lacks any contextual advice.

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/FutureAtoms/agentic-control-framework'

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