Skip to main content
Glama

browser_wait_for

Pauses browser automation until specific conditions are met, such as waiting for text to appear or disappear, or for a set duration to pass.

Instructions

Wait for condition

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeNo
textNo
textGoneNo

Implementation Reference

  • index.js:424-432 (registration)
    Registration of the browser_wait_for tool in the MCP server. It delegates the execution to proxyToolCall.
    server.tool('browser_wait_for', 'Wait for condition', {
      time: z.number().optional(),
      text: z.string().optional(),
      textGone: z.string().optional()
    }, async (args) => {
      const check = requireActivePage();
      if (check) return check;
      return proxyToolCall('browser_wait_for', args);
    });
  • The proxyToolCall function acts as a wrapper that forwards tool execution requests to an underlying MCP client instance.
    async function proxyToolCall(toolName, args) {
      log(`[proxyToolCall] ${toolName} with args: ${JSON.stringify(args)}`);
      const { client } = await getOrCreateInstance();
      log(`[proxyToolCall] got client for port ${assignedPort}`);
    
      // Update last used
      if (assignedPort && instances.has(assignedPort)) {
        instances.get(assignedPort).lastUsed = Date.now();
      }
    
      try {
        log(`[proxyToolCall] Calling client.callTool...`);
        const result = await client.callTool({ name: toolName, arguments: args || {} });
        log(`[proxyToolCall] Result type: ${typeof result}`);
        log(`[proxyToolCall] Result: ${JSON.stringify(result).slice(0, 500)}`);
    
        // The SDK returns { content: [...], isError?: boolean }
        // We need to return this same format
        if (result && result.content) {
          return result;
        }
    
        // Fallback: wrap in content array if needed
        return {
          content: [{ type: 'text', text: JSON.stringify(result) }]
        };
      } catch (error) {
        log(`[proxyToolCall] ERROR: ${error.message}\n${error.stack}`);
        return {
Behavior1/5

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

No annotations are provided, yet the description discloses zero behavioral traits. It does not explain whether this blocks execution, what happens on timeout, polling frequency, or how the three parameters interact (mutually exclusive? sequential?). Full burden falls on the description, which provides nothing.

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?

While brief (3 words), this represents under-specification rather than efficient conciseness. The single sentence communicates almost nothing beyond the tool name itself and fails to front-load critical information about the three distinct wait modes.

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?

With 3 parameters, 0% schema coverage, no annotations, and no output schema, this description is completely inadequate for a browser automation tool. Critical information missing includes timeout behavior, polling mechanisms, and parameter precedence rules.

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?

Schema description coverage is 0%, and the description fails to compensate. The relationships between 'time' (units? behavior?), 'text' (substring matching? exact match?), and 'textGone' (wait until disappears?) are completely undocumented. Agent must guess parameter semantics.

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

Purpose2/5

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

The description 'Wait for condition' is almost tautological given the tool name 'browser_wait_for'. While it indicates the tool involves waiting, it fails to specify what constitutes a 'condition' (element presence, text appearance, time duration) or distinguish this from sibling tools like browser_snapshot that also observe state.

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?

Absolutely no guidance provided on when to use this tool versus alternatives, or how to choose between the three parameter options (time, text, textGone). The agent cannot determine if this is for explicit delays, polling for elements, or waiting for page stability.

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/OMGEverdo/browser-pool-mcp'

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