tc_login
Sign in to Trimble Connect via browser OAuth2 to obtain access tokens. Use this before other tools; it returns pending until you complete sign-in.
Instructions
Sign in to Trimble Connect via the browser (OAuth2 + PKCE).
Opens the user's default browser at the Trimble Identity login page and listens on the registered localhost callback (TC_REDIRECT_URI, default http://localhost:8385/callback). Tokens are cached locally and refreshed automatically, so this is only needed the first time or after the session fully expires.
The call does NOT block indefinitely: if the sign-in is not finished within wait_seconds it returns {"pending": true, "auth_url": ...} while the callback listener keeps waiting in the background (up to 10 minutes total). In that case tell the user to finish signing in — opening auth_url manually if no browser appeared — and then call tc_auth_status to confirm. Do NOT immediately call tc_login again; a second call simply waits on the same pending login.
Args: wait_seconds: How long to wait before returning a pending result (default 90). Use a small value to return quickly. open_browser: Set false to only return auth_url without launching a browser (useful when the browser cannot be opened automatically).
Returns: {"logged_in": true, "user": {...}} on success, {"logged_in": false, "pending": true, "auth_url": ...} if the user has not finished yet, or {"error": ...}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| open_browser | No | ||
| wait_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |