INNER CODE UNIT · Python
browser_press_key
feder-cr/Jobs_Applier_AI_Agent_AIHawk · src/aihawk/mcp/server.py:600
async def browser_press_key(key: str, browser: Browser = None) -> str:
"""Press a key on whatever has focus: "Enter", "Tab", "Escape",
"ArrowDown", "Control+a", or a single character."""
return await work.acting(actions.press_key, key, role=browser)
@mcp.tool(annotations=_says("Read the page with JavaScript", read_only=True))
async def browser_evaluate(expression: str, browser: Browser = None) -> str:
"""READ from the page with JavaScript and get the result as JSON.
For what the other tools cannot see: a computed style, a value held in a
framework's state, the length of a list.
Acting on the page is refused, and the refusal names the tool to use.
Assigning to `value`, `checked` or `selected`, or calling `click()`,
`dispatchEvent()`, `submit()` or `requestSubmit()`, changes the page without
a real keystroke or pointer, and a page can tell. Use browser_click,
browser_type or browser_select_option instead; they do the same thing