INNER CODE UNIT · Python
run_browser_task
tiliondev/fortress · mcp/server.py:259
async def run_browser_task(task: str, url: str, params: dict | None = None) -> dict:
"""Run a multi-step browser automation on a stealth browser that won't get
flagged as a bot — logging in, paginating, infinite-scroll collection, table
extraction, form fill, file download, multi-step checkout, SPA navigation.
Use when a task needs real interaction (not just a fetch) on a site that
detects/blocks automation. `task` is a flow name from `list_browser_tasks`;
`params` carries flow arguments (selectors, credentials, etc).
"""
valid = set(Tilion.list_tasks())
if task not in valid:
return {"status": "error",
"error": f"unknown task {task!r}; call list_browser_tasks for valid names"}
if url:
await _check_url(url)
await _check_params_urls(params) # SSRF-check URL-bearing flow params too
t = await _t()
return await t.agent(task, url=url, **(params or {}))