session_refresh
Refresh HEB session cookies and tokens to maintain access. Automates login, handles CAPTCHA, 2FA, and security challenges, returning success or requesting human intervention when needed.
Instructions
Refresh HEB session cookies and tokens.
Uses embedded browser when available (fast: ~10-15 seconds). If credentials are saved and login is required, attempts automatic login. Falls back to returning Playwright MCP commands if browser dependencies aren't installed.
Args: headless: Run browser without visible window (default True). Set to False if you need to complete a manual login (e.g., when your session has fully expired). timeout: Maximum time to wait for page load in milliseconds. Default 30000 (30 seconds). login_timeout: Maximum time to wait for manual login in milliseconds. Default 300000 (5 minutes). Only used when headless=False. use_saved_credentials: If True and credentials are stored, attempt automatic login when session is expired. Default True.
Returns: dict with one of these statuses: - {"status": "success", ...} - Login/refresh completed successfully - {"status": "human_action_required", "action": "login" | "captcha" | "2fa" | "waf", ...} Human intervention required (login form, CAPTCHA, 2FA, or a WAF/security interstitial). The browser remains open; complete the action, then call session_refresh() again. - {"status": "failed", ...} - Login/refresh failed with error details
Use this tool when:
session_status shows needs_refresh: true
session_status shows refresh_recommended: true
product_search returns security_challenge_detected: true
You want to proactively refresh before token expires
CAPTCHA/2FA handling:
When CAPTCHA or 2FA is detected, returns immediately with screenshot_path
The screenshot shows exactly what the user sees in the browser
Use the Read tool to view the screenshot and describe it to the user
The browser stays open - user solves CAPTCHA/enters code in that window
After solving, call session_refresh() again to continue the login flow
Repeat until status is "success" or "failed"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | ||
| headless | No | ||
| login_timeout | No | ||
| use_saved_credentials | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||