Skip to main content
Glama

browser_type

Types text into a web page element identified by CSS selector, simulating keyboard input for form filling or search queries.

Instructions

Type text into a DOM element matched by CSS selector in a real browser, simulating real keyboard input.

中文详情:

  • 用途:在真实浏览器中向指定 CSS 选择器元素输入文本(输入框、文本域、搜索框等)

  • 何时使用:填写登录表单用户名/密码时;搜索框输入查询词时;textarea 输入长文本时;测试输入框字符限制时

  • 输出:{ ok: boolean, typedSelector: string, textLength: number, timestamp: string }

  • 参数:

    • selector (string, 必填):CSS 选择器,支持 Playwright 语法

    • text (string, 必填):要输入的文本内容

  • 错误:选择器无匹配抛出 'element not found';元素不可编辑抛出 'element not editable'

  • 示例:{"selector":"#username","text":"testuser@example.com"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes要输入的文本
selectorYesCSS 选择器
Behavior3/5

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

With no annotations, the description carries full burden. It mentions simulating real keyboard input but does not disclose details like whether it clears existing text, supports special keys, or handles events. It does list errors and output, but overall transparency is moderate.

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

Conciseness4/5

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

The description is well-structured with English summary and Chinese details. It is concise but includes necessary usage guidance, error info, and example. The bilingual approach adds some redundancy but remains efficient.

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

Completeness4/5

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

Given no annotations and no output schema, the description covers purpose, usage, parameters, errors, and output format. It is fairly complete for a two-parameter tool, though behavioral details could be richer.

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

Parameters4/5

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

Schema coverage is 100%, yet the description adds value by explaining each parameter's purpose (e.g., 'CSS selector, supports Playwright syntax') and providing an example. This goes beyond the schema's minimal descriptions.

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

Purpose5/5

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

The description clearly states 'Type text into a DOM element matched by CSS selector in a real browser, simulating real keyboard input.' This provides a specific verb, resource, and nuance, distinguishing it from siblings like browser_click or browser_aria_type.

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

Usage Guidelines4/5

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

The description includes explicit 'when to use' scenarios in Chinese (e.g., filling login forms, search boxes, textarea, testing input limits), providing clear context. It does not explicitly mention when not to use or alternatives, but the guidance is strong.

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/validpilot/ai-verify-mcp'

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