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);

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