Press key
press_keySimulates a trusted keyboard key press in the browser to trigger native key events and framework shortcuts that bulk text insertion misses. Optionally focuses a selector and supports modifier keys.
Instructions
Press one key as a real keyboard event, with its native effect.
The browser produces keydown, keypress (for printable keys) and keyup, all trusted, and does what the key does: Enter submits the enclosing form or activates a focused button, Tab moves focus, Backspace deletes. Use when a framework listens for key events that type_text's bulk insert does not fire. Focuses selector first when given. Returns the key pressed and the element focused first, if any.
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": {
"key": "<key>"
},
"name": "press_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Key name for named keys ('Enter', 'Tab', 'Escape', 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Space', 'Home', 'End', 'PageUp', 'PageDown'), or a single character for literal keys. Example: 'Enter' | |
| tab | No | Tab id from list_tabs or new_tab to act on, instead of the active tab. The active tab does not change. Omit to use the active tab. Example: 'tab_2' | |
| selector | No | CSS selector, or a numeric id from get_interaction_tree, of the element to focus first. Omit to target whatever currently has focus. Example: '#search' | |
| modifiers | No | Modifier keys held during the press, for shortcuts. Example: ['Control'] with key 'a' selects all |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | The key pressed. | |
| target | No | Element focused first, if any. | |
| summary | Yes | One line saying what happened. |