Skip to main content
Glama
jomon003

PlayMCP Browser Automation Server

by jomon003

type

Enter text into web page elements using CSS selectors to automate form filling, search queries, and data entry tasks in browser automation workflows.

Instructions

Type text into an element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYes
textYes

Implementation Reference

  • Core implementation of the 'type' tool: types text into the specified selector using Playwright's page.type() method.
    async type(selector: string, text: string): Promise<void> {
      try {
        if (!this.isInitialized()) {
          throw new Error('Browser not initialized');
        }
        this.log('Typing into element', { selector, text });
        await this.state.page?.type(selector, text);
        this.log('Type complete');
      } catch (error: any) {
        console.error('Type error:', error);
        throw new BrowserError('Failed to type text', 'Check if the input element exists and is editable');
      }
    }
  • Input schema definition for the 'type' tool, specifying selector and text parameters.
    const TYPE_TOOL: Tool = {
      name: "type",
      description: "Type text into an element",
      inputSchema: {
        type: "object",
        properties: {
          selector: { type: "string" },
          text: { type: "string" }
        },
        required: ["selector", "text"]
      }
    };
  • src/server.ts:517-517 (registration)
    Registration of the 'type' tool in the tools dictionary used by the MCP server.
    type: TYPE_TOOL,
  • Dispatch handler in callTool request handler that validates input and delegates to playwrightController.type.
    case 'type': {
      if (!args.selector || !args.text) {
        return {
          content: [{ type: "text", text: "Selector and text are required" }],
          isError: true
        };
      }
      await playwrightController.type(args.selector as string, args.text as string);
      return {
        content: [{ type: "text", text: "Text entered successfully" }]
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but lacks details on permissions, side effects (e.g., if typing triggers events), error handling, or performance aspects. This is a significant gap for a mutation tool with zero annotation coverage.

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 no wasted words, making it easy to parse and front-loaded. Every word contributes directly to stating the tool's purpose, earning a high score for conciseness.

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 complexity of a mutation tool with 2 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It fails to address behavioral traits, parameter details, or usage context, leaving significant gaps for an AI agent to understand and invoke the tool correctly.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'an element' and 'text', which loosely map to 'selector' and 'text', but does not explain what a selector is (e.g., CSS selector, XPath), format requirements, or constraints. This adds minimal value beyond the bare schema.

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 'Type text into an element' clearly states the action (type) and target (an element), making the purpose understandable. However, it does not explicitly differentiate from sibling tools like 'pressKey' or 'executeJavaScript', which might have overlapping functionality, so it lacks sibling differentiation for a perfect score.

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. With many sibling tools like 'pressKey', 'executeJavaScript', or 'selectOption', there is no indication of specific contexts, prerequisites, or exclusions for using 'type' over others.

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/jomon003/PlayMCP'

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