fix: get_gear uses numeric userProfilePk, complete_mfa resets state on timeout
This commit is contained in:
@@ -97,7 +97,8 @@ def complete_mfa(code: str) -> str:
|
||||
return "MFA accepted. Authenticated successfully."
|
||||
return f"Authentication failed after MFA: {err}"
|
||||
except queue.Empty:
|
||||
return "Timed out waiting for authentication to complete."
|
||||
_auth_state = "unauthenticated"
|
||||
return "Timed out waiting for authentication to complete. Call authenticate() again."
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
@@ -288,7 +289,11 @@ def get_gear() -> str:
|
||||
if err := _check_auth():
|
||||
return err
|
||||
try:
|
||||
result = _client.get_gear(_client.display_name)
|
||||
profile = _client.get_user_profile()
|
||||
user_id = profile.get("userId") or profile.get("id")
|
||||
if not user_id:
|
||||
return "Could not determine user profile ID required for gear lookup."
|
||||
result = _client.get_gear(str(user_id))
|
||||
if not result:
|
||||
return "No gear found."
|
||||
return json.dumps(result, indent=2)
|
||||
|
||||
Reference in New Issue
Block a user