Skip to main content
Glama

browser_wait_for_element

Wait for a specified web element to appear using a selector and optional timeout. Supports parallel browser instances in the Concurrent Browser MCP server for efficient automation.

Instructions

Wait for an element to appear

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceIdYesInstance ID
selectorYesElement selector
timeoutNoTimeout in milliseconds

Implementation Reference

  • The main handler function for 'browser_wait_for_element' that waits for a selector using Playwright's page.waitForSelector.
    private async waitForElement(instanceId: string, selector: string, timeout: number): Promise<ToolResult> { const instance = this.browserManager.getInstance(instanceId); if (!instance) { return { success: false, error: `Instance ${instanceId} not found` }; } try { await instance.page.waitForSelector(selector, { timeout }); return { success: true, data: { selector, found: true }, instanceId }; } catch (error) { return { success: false, error: `Wait for element failed: ${error instanceof Error ? error.message : error}`, instanceId }; } }
  • src/tools.ts:569-570 (registration)
    Dispatch/registration of the tool handler in the executeTools switch statement.
    case 'browser_wait_for_element': return await this.waitForElement(args.instanceId, args.selector, args.timeout || 30000);
  • Tool schema and registration definition returned by getTools(), including name, description, and inputSchema.
    name: 'browser_wait_for_element', description: 'Wait for an element to appear', inputSchema: { type: 'object', properties: { instanceId: { type: 'string', description: 'Instance ID' }, selector: { type: 'string', description: 'Element selector', }, timeout: { type: 'number', description: 'Timeout in milliseconds', default: 30000 } }, required: ['instanceId', 'selector'] } },

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