Skip to main content
Glama
eva-wanxin-git

Windows Automation MCP Server

browser_type

Input text into browser elements using CSS selectors for automated web interactions within Windows automation workflows.

Instructions

输入文本到元素

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS 选择器
textYes要输入的文本
sessionIdNo会话 ID(可选)

Implementation Reference

  • The `type` method implements the core logic for the 'browser_type' tool: waits for the selector, types the provided text into the element using Puppeteer.
    async type(selector, text, sessionId = 'default') {
      try {
        const page = this.pages.get(sessionId);
        if (!page) {
          return { success: false, error: '浏览器未启动' };
        }
    
        await page.waitForSelector(selector, { timeout: 5000 });
        await page.type(selector, text);
    
        return { success: true, selector, text, message: '输入成功' };
      } catch (error) {
        return { success: false, error: error.message };
      }
    }
  • Input schema definition for the 'browser_type' tool, specifying parameters: selector (required), text (required), and optional sessionId.
      name: 'browser_type',
      description: '输入文本到元素',
      inputSchema: {
        type: 'object',
        properties: {
          selector: { type: 'string', description: 'CSS 选择器' },
          text: { type: 'string', description: '要输入的文本' },
          sessionId: { type: 'string', description: '会话 ID(可选)' },
        },
        required: ['selector', 'text'],
      },
    },
  • Dispatch in `executeTool` method that routes 'browser_type' calls to the `type` handler.
    case 'browser_type':
      return await this.type(args.selector, args.text, args.sessionId);
  • Inclusion of 'browser_type' in the `canHandle` method's tool list for capability checking.
    const tools = ['browser_launch', 'browser_navigate', 'browser_click', 
                   'browser_type', 'browser_screenshot', 'browser_get_text', 'browser_close'];
    return tools.includes(toolName);
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. It states the action but lacks details on behavioral traits such as whether it requires a browser session, handles errors, waits for elements, or has side effects. This is inadequate for a tool that interacts with UI elements.

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 phrase ('输入文本到元素') that directly conveys the core action without unnecessary words. It's front-loaded and appropriately sized for its purpose.

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 no annotations, no output schema, and a tool that performs UI interaction, the description is incomplete. It doesn't cover expected outcomes, error conditions, or dependencies (e.g., needing an active browser session), leaving significant gaps for agent usage.

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 clear descriptions for 'selector' (CSS selector), 'text' (text to input), and 'sessionId' (optional session ID). The description adds no additional meaning beyond the schema, so it meets the baseline but doesn't enhance parameter understanding.

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 '输入文本到元素' (Input text to element) clearly states the action (input text) and target (element), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'type_text' or 'press_key', which might have overlapping functionality in text input scenarios.

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 siblings like 'type_text' and 'press_key' available, there's no indication of context-specific usage, prerequisites, or exclusions, leaving the agent to guess based on tool names alone.

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/eva-wanxin-git/windows-automation-mcp'

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