press_key
Simulates keyboard input in the active browser tab, including key combinations and repeated presses; optionally focuses a selector first so agents can submit forms or navigate.
Instructions
Press a key via CDP keyboard input in the session's active tab. key is a name (Enter, Tab, Escape, Backspace, ArrowDown, Space, …), a single character, or a combination held down together such as Shift+Tab or Control+a (modifiers: Shift, Control, Alt, Meta). With a selector (CSS; or plain language — a jev: goal such as jev: the password field goes straight to the Jev decision model, and with TYPESAFE_API_KEY set a selector that matches nothing as CSS is retried as plain language), waits up to timeout for it and focuses it first (e.g. type into a field then press Enter); without, presses on whatever is focused, and timeout is unused. Use type for whole strings and click to activate buttons. Pressing Enter can submit a form, like a real user. Returns a confirmation. Fails on an unknown key name, or if the selector matches nothing within timeout and Jev can't (or isn't configured to) resolve it.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sessionId": "<sessionId>",
"key": "<key>"
},
"name": "press_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Key name in the US layout (Enter, Tab, Escape, Backspace, ArrowDown, Space…), one character, or a combination such as Shift+Tab or Control+a. | |
| repeat | No | Press it this many times (at most 50), e.g. to walk focus with Tab; the result's `focusTrail` lists the focused element after each press. Default 1. | |
| timeout | No | Milliseconds to wait for `selector` to appear. Default 5000. | |
| selector | No | CSS selector of an element to focus before pressing. Or describe it in plain words (`jev:<goal>` goes straight to the Jev decision model; when TYPESAFE_API_KEY is set a selector that matches nothing as CSS is retried as such a description). Omit to press on the focused element. | |
| sessionId | Yes | The id returned by open_browser_session. Errors if no open session has it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hit | No | What was at the clicked or tapped point. | |
| url | Yes | The page's URL after the action. | |
| title | Yes | The page's title after the action. | |
| dialog | No | An open dialog's text, if one is showing. | |
| changed | No | A field `type` filled that the page changed once focus left it (a date that reformats or reverts on blur), with both texts. | |
| focused | Yes | The element with keyboard focus, or "nothing". | |
| options | No | The options of a dropdown or list open after the action (the one the focused field controls, else any showing), up to 50: pick one with select_option or click. | |
| answered | No | The page's own dialogs (alert, confirm, prompt, "Leave site?") answered since the last action, each accepted. | |
| rejected | No | Fields the page rejected during the action, each with its message: the browser's own form check (a required field left empty), or the page marking them invalid. The form wasn't sent while any remain. | |
| navigated | Yes | Whether the URL changed. | |
| focusTrail | No | With press_key's `repeat`: the focused element after each press. |