browser_press_key
Press keyboard keys such as Enter, Tab, Escape, or arrow keys to submit forms, navigate dropdowns, close dialogs, and send modifier-key shortcuts in a browser.
Instructions
Press a keyboard key (Enter, Tab, Escape, ArrowDown, etc.). Useful for submitting forms, navigating dropdowns, closing dialogs. Supports modifier keys (ctrl, alt, shift, meta). Enter acts like the real key (the page gets keydown, keypress and keyup 13): in a text field it submits the form, on a focused button it presses it, and in a textarea it adds a line break - from 1.33; before, it did none of these, so press Enter only when that is what you want. "Space" is the space bar: in a field it types a space, on a focused button it presses it, and on a checkbox it ticks it (from 1.33; before, it did none of these). Key codes follow the US layout: punctuation is sent as the key it sits on ("," is keyCode 188, code "Comma"), and a shifted character such as "<" or "@" is that key with Shift held; a capital letter is sent without Shift. shift does not change the character ("," with shift is still a comma). While ctrl, meta or alt is held, no character is typed. With ctrl or meta (and no shift), the letters a, c, x, v, z and y are sent with Chrome's own editing command - select all, copy, cut, paste, undo, redo; z with shift is redo - including on macOS, where Chrome runs no shortcut for a synthetic key without it. The answer names the command that was sent in shortcut; landed says the page received the key, not what the command did. Paste inserts the user's real clipboard into the page, and copy and cut replace what is on 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": {
"key": "<key>"
},
"name": "browser_press_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alt | No | Hold Alt key | |
| key | Yes | Key to press: "Enter", "Tab", "Escape", "ArrowDown", "ArrowUp", "Backspace", "a", "1", etc. | |
| code | No | Physical key code (optional). Without it, the key it sits on in the US layout: "KeyA" for "a", "Comma" for ",", "Digit2" for "@"; a character not on a US keyboard gets none. Setting it changes only the code, not the key code | |
| ctrl | No | Hold Ctrl/Cmd key | |
| meta | No | Hold Meta (Cmd on Mac) key | |
| shift | No | Hold Shift key | |
| partition | No | Run this call in a partition from browser_partition (an id like "p1"). Leave it out for the default partition. An unknown or closed id is an error; the call is never sent to the default partition instead. |