@@ -152,12 +152,16 @@ class CloudOrganizationResult(BaseModel):
152152class CloudWorkspaceResult (BaseModel ):
153153 """Information about a workspace in Airbyte Cloud."""
154154
155- id : str
155+ workspace_id : str
156156 """The workspace ID."""
157- name : str
157+ workspace_name : str
158158 """Display name of the workspace."""
159+ workspace_url : str | None = None
160+ """URL to access the workspace in Airbyte Cloud."""
159161 organization_id : str
160162 """ID of the organization this workspace belongs to."""
163+ organization_name : str | None = None
164+ """Name of the organization this workspace belongs to."""
161165
162166
163167class LogReadResult (BaseModel ):
@@ -463,18 +467,30 @@ def check_airbyte_cloud_workspace(
463467 default = None ,
464468 ),
465469 ],
466- ) -> str :
470+ ) -> CloudWorkspaceResult :
467471 """Check if we have a valid Airbyte Cloud connection and return workspace info.
468472
469- Returns workspace ID and workspace URL for verification .
473+ Returns workspace details including workspace ID, name, and organization info .
470474 """
471475 workspace : CloudWorkspace = _get_cloud_workspace (workspace_id )
472- workspace .connect ()
476+ api_root = resolve_cloud_api_url ()
477+ client_id = resolve_cloud_client_id ()
478+ client_secret = resolve_cloud_client_secret ()
473479
474- return (
475- f"✅ Successfully connected to Airbyte Cloud workspace.\n "
476- f"Workspace ID: { workspace .workspace_id } \n "
477- f"Workspace URL: { workspace .workspace_url } "
480+ # Get workspace details from the public API
481+ workspace_response = api_util .get_workspace (
482+ workspace_id = workspace .workspace_id ,
483+ api_root = api_root ,
484+ client_id = client_id ,
485+ client_secret = client_secret ,
486+ )
487+
488+ return CloudWorkspaceResult (
489+ workspace_id = workspace_response .workspace_id ,
490+ workspace_name = workspace_response .name ,
491+ workspace_url = workspace .workspace_url ,
492+ organization_id = workspace .organization_id or "[error: organization ID not discovered]" ,
493+ organization_name = workspace .organization_name ,
478494 )
479495
480496
@@ -1242,8 +1258,8 @@ def list_cloud_workspaces(
12421258
12431259 return [
12441260 CloudWorkspaceResult (
1245- id = ws .get ("workspaceId" , "" ),
1246- name = ws .get ("name" , "" ),
1261+ workspace_id = ws .get ("workspaceId" , "" ),
1262+ workspace_name = ws .get ("name" , "" ),
12471263 organization_id = ws .get ("organizationId" , "" ),
12481264 )
12491265 for ws in workspaces
0 commit comments