type_text
Type text into input fields with realistic keystroke delays to mimic human interaction and bypass bot detection.
Instructions
Type text into an input field with realistic keystroke delays.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | ||
| text | Yes | ||
| delay | No |
Implementation Reference
- The async function that implements the type_text tool. It takes 'selector', 'text', and optional 'delay' parameters, retrieves the active page from browser_manager, uses Playwright's page.type() to simulate typing with realistic keystroke delays, and returns a status dict.
@mcp.tool() async def type_text(selector: str, text: str, delay: int = 50) -> dict: """Type text into an input field with realistic keystroke delays.""" try: page = await browser_manager.get_active_page() await page.type(selector, text, delay=delay) return {"status": "typed", "selector": selector, "text": text} except Exception as e: return {"error": str(e)} - The input schema is defined via Python type hints on the function signature: selector (str), text (str), delay (int, default 50). The return type is dict.
async def type_text(selector: str, text: str, delay: int = 50) -> dict: - src/camoufox_reverse_mcp/tools/navigation.py:324-324 (registration)The tool is registered via the @mcp.tool() decorator applied to the function. 'mcp' is a FastMCP instance created in src/camoufox_reverse_mcp/server.py line 4. The navigation module is imported at server.py line 15, which triggers all @mcp.tool() registrations.
@mcp.tool() - The FastMCP server instance and BrowserManager that type_text depends on. browser_manager.get_active_page() is called within the handler to get the current page.
mcp = FastMCP( "camoufox-reverse-mcp", instructions="Anti-detection browser MCP server for JavaScript reverse engineering. " "Uses Camoufox (C++ engine-level fingerprint spoofing) to bypass bot detection " "while performing JS analysis, debugging, hooking, network interception, " "and JSVMP bytecode analysis." ) browser_manager = BrowserManager()