Skip to main content
Glama

type

Simulate user text entry in web forms for automated testing. Enter specified text into input fields using CSS selectors to validate form functionality during QA processes.

Instructions

Type text into an input field identified by a CSS selector

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector of the input field
textYesText to type

Implementation Reference

  • The core handler function for the 'type' tool that uses Puppeteer to type text into the specified selector on the browser page.
    async type(selector: string, text: string) { const page = await this.init(); try { await page.waitForSelector(selector, { timeout: 5000 }); await page.type(selector, text); return `Typed "${text}" into ${selector}`; } catch (e: any) { throw new Error(`Failed to type into ${selector}: ${e.message}`); } }
  • Input schema definition for the 'type' tool, specifying parameters selector and text.
    type: "object", properties: { selector: { type: "string", description: "CSS selector of the input field" }, text: { type: "string", description: "Text to type" }, }, required: ["selector", "text"], },
  • src/index.ts:49-59 (registration)
    Tool registration in the TOOLS array used for listTools response.
    name: "type", description: "Type text into an input field identified by a CSS selector", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector of the input field" }, text: { type: "string", description: "Text to type" }, }, required: ["selector", "text"], }, },
  • src/index.ts:126-128 (registration)
    Dispatcher/registration of the 'type' tool handler in the callTool switch statement.
    case "type": result = await browserManager.type(String(args?.selector), String(args?.text)); break;

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/samusilv/qa-agent-mcp'

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