type_text
Enter text into web forms and input fields during browser automation sessions. This tool simulates keyboard input for automated testing and interaction with web applications.
Instructions
输入文本内容
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | 要输入的文本内容 |
Implementation Reference
- src/browserSession.ts:481-485 (handler)Core handler implementation that performs the text typing using Puppeteer's page.keyboard.type(), wrapped in doAction for error handling, logging, and screenshot capture.
async type(text: string): Promise<BrowserActionResult> { return this.doAction(async (page) => { await page.keyboard.type(text); }); } - src/index.ts:196-201 (handler)Tool dispatcher in CallToolRequestSchema handler that validates input and delegates to browserSession.type().
case "type_text": if (!args?.text) { throw new Error("text参数是必需的"); } result = await this.browserSession.type(args.text as string); break; - src/index.ts:96-109 (registration)Tool registration including name, description, and input schema in the ListToolsRequestSchema response.
{ name: "type_text", description: "输入文本内容", inputSchema: { type: "object", properties: { text: { type: "string", description: "要输入的文本内容", }, }, required: ["text"], }, }, - src/index.ts:99-109 (schema)Input schema definition for the type_text tool.
inputSchema: { type: "object", properties: { text: { type: "string", description: "要输入的文本内容", }, }, required: ["text"], }, }, - src/index.ts:311-312 (helper)Helper function generating success message for type_text tool.
case "type_text": return "✅ 文本输入完成";