Skip to main content
Glama

按键

web_press

Send keyboard events like Enter, Escape, Tab, Control+a to web pages. Use a selector or reference to target a specific element, or fall back to the focused element.

Instructions

按下键盘按键(如 Enter、Escape、Tab、Control+a)。可先用 ref/selector 聚焦目标元素;未提供时作用于当前聚焦元素。

权限说明:发送键盘事件到当前页面。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes按键名,遵循 Playwright 按键规范,如 Enter / Control+a / F5
refNo最近一次快照中的引用编号,与 selector 二选一
timeoutNo超时毫秒数,默认 10 秒,0 表示不限制
selectorNoCSS 选择器、text=关键词 或 testid=值,与 ref 二选一
Behavior3/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 discloses that the tool sends keyboard events to the current page and explains the fallback behavior for the focused element. However, it does not mention potential side effects (e.g., navigation triggered by certain keys), how the tool handles page state, or what happens if the key press fails, leaving transparency gaps.

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 two concise sentences, front-loaded with the primary purpose and followed by usage guidance and a permission note. Every sentence earns its place with no redundant or filler content.

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

Completeness3/5

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

The tool is relatively simple with four parameters, one required, and no output schema. The description covers the core usage and permission scope, but it omits details about return values or how success is signaled, and it does not explain how the timeout parameter affects behavior beyond the schema. Given the lack of an output schema, a bit more context on expected outcomes would improve completeness.

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 description coverage is 100%, so the baseline is 3. The description adds extra meaning beyond the schema by explaining that ref/selector can be used to focus the target element and that omitting them results in acting on the currently focused element. This clarifies the intended usage of the parameters and adds a crucial behavioral detail not fully captured by the schemas alone.

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 clearly states the tool's function: pressing keyboard keys (e.g., Enter, Escape, Control+a). It specifies the resource (keyboard) and provides concrete examples, making the purpose obvious. It lacks explicit differentiation from sibling tools like web_type, but the key-based action is distinct enough to avoid major confusion.

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

Usage Guidelines3/5

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

The description provides guidance on how to use the tool: it can first focus a target element via ref/selector, and if not provided, it operates on the currently focused element. This gives clear usage context, but it does not explicitly state when to prefer this tool over alternatives (e.g., web_type) or when not to use it, leaving the decision implicit.

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/JohnXu22786/browser-automation'

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