Skip to main content
Glama

click_element

Automate web interactions by clicking elements using CSS selectors with AutoProbeMCP. Specify a selector and optional timeout to interact with web pages programmatically.

Instructions

Click on an element by CSS selector

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for the element to click
timeoutNoTimeout in milliseconds

Implementation Reference

  • Handler for the 'click_element' tool. Validates input parameters using ClickElementSchema, performs a click on the specified selector using Playwright's page.click method with optional timeout, and returns a confirmation message.
    case 'click_element': { if (!currentPage) { throw new Error('No browser page available. Launch a browser first.'); } const params = ClickElementSchema.parse(args); await currentPage.click(params.selector, { timeout: params.timeout }); return { content: [ { type: 'text', text: `Clicked element: ${params.selector}` } ] }; }
  • Zod schema defining the input parameters for the click_element tool: selector (required string) and timeout (optional number, default 5000ms).
    const ClickElementSchema = z.object({ selector: z.string(), timeout: z.number().default(5000) });
  • src/index.ts:177-195 (registration)
    Tool registration in the list_tools response, providing name, description, and inputSchema matching the Zod schema.
    { name: 'click_element', description: 'Click on an element by CSS selector', inputSchema: { type: 'object', properties: { selector: { type: 'string', description: 'CSS selector for the element to click' }, timeout: { type: 'number', default: 5000, description: 'Timeout in milliseconds' } }, required: ['selector'] } },

Other Tools

Related 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/Wladastic/AutoProbeMCP'

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