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);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions typing text but doesn't specify whether this simulates keystrokes, triggers events, requires the field to be interactable, or handles errors like invalid selectors. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste, front-loading the core action. It's appropriately sized for a simple tool, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's mutation nature (typing implies changing state), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like error handling, success conditions, or interaction with page state, which are crucial for an agent to use this tool correctly in a browser automation context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters ('selector' and 'text') clearly documented in the schema. The description adds no additional meaning beyond what the schema provides, such as examples or constraints on selector syntax. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Type text') and target ('into an input field'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from sibling tools like 'fill_form' or 'select', which might have overlapping functionality for interacting with form elements.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'fill_form' or 'select' from the sibling list. It lacks context about prerequisites (e.g., whether the input field must be visible or focused) or exclusions, leaving the agent to infer usage scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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