Skip to main content
Glama

wait_for_element

Pause execution until a specific element appears in the Firefox browser, using a selector and optional timeout for efficient automation and debugging workflows.

Instructions

Wait for element to appear

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYes
tabIdNo
timeoutNo

Implementation Reference

  • The core handler function that implements the wait_for_element tool logic using Playwright's page.waitForSelector to wait for the specified selector on the given tab/page.
    async waitForElement(args) { this.ensureBrowserRunning(); const { selector, timeout = 30000, tabId } = args; const page = this.getPage(tabId); await page.waitForSelector(selector, { timeout }); return { content: [{ type: 'text', text: `Element '${selector}' found in tab '${tabId || this.activeTabId}'` }] }; }
  • The input schema and tool metadata definition returned in ListToolsRequestSchema response.
    { name: 'wait_for_element', description: 'Wait for element to appear', inputSchema: { type: 'object', properties: { selector: { type: 'string' }, timeout: { type: 'number', default: 30000 }, tabId: { type: 'string' } }, required: ['selector'] } },
  • The switch case in CallToolRequestSchema handler that registers and dispatches calls to the waitForElement handler.
    case 'wait_for_element': return await this.waitForElement(args); case 'execute_script':

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/JediLuke/firefox-mcp-server'

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