Skip to main content
Glama

type

Enter text into web form fields using CSS selectors to automate form filling, data entry, and user interaction tasks during browser automation.

Instructions

Type text into an input field

Input Schema

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

Implementation Reference

  • The handler function for the MCP 'type' tool. It receives selector and text parameters and delegates to the browser.type method, returning a success message.
    handler: async ({ selector, text }) => { await browser.type(selector, text); return { success: true, message: `Typed "${text}" into ${selector}` }; }
  • The input schema for the 'type' tool, specifying the required selector (string) and text (string) parameters.
    inputSchema: { type: 'object', properties: { selector: { type: 'string', description: 'CSS selector for the input field' }, text: { type: 'string', description: 'Text to type' } }, required: ['selector', 'text'] },
  • The complete tool registration object for the 'type' tool, including name, description, inputSchema, and handler. This object is included in the playwright tools array exported by createPlaywrightTools.
    { name: 'type', description: 'Type text into an input field', inputSchema: { type: 'object', properties: { selector: { type: 'string', description: 'CSS selector for the input field' }, text: { type: 'string', description: 'Text to type' } }, required: ['selector', 'text'] }, handler: async ({ selector, text }) => { await browser.type(selector, text); return { success: true, message: `Typed "${text}" into ${selector}` }; }
  • The browser.type helper method implementation, which ensures the browser is launched and performs the actual text input using Playwright's page.fill method.
    async type(selector, text) { await this.ensureLaunched(); await this.page.fill(selector, text); }

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/zypin-testing/zypin-mcp'

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