Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions airbyte/mcp/cloud_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ class CloudWorkspaceResult(BaseModel):
"""Display name of the workspace."""
organization_id: str
"""ID of the organization this workspace belongs to."""
organization_name: str | None = None
"""Name of the organization this workspace belongs to."""


class LogReadResult(BaseModel):
Expand Down Expand Up @@ -463,18 +465,30 @@ def check_airbyte_cloud_workspace(
default=None,
),
],
) -> str:
) -> CloudWorkspaceResult:
"""Check if we have a valid Airbyte Cloud connection and return workspace info.

Returns workspace ID and workspace URL for verification.
Returns workspace details including workspace ID and name. Organization info is not
currently available from the public API for a single workspace lookup.
"""
workspace: CloudWorkspace = _get_cloud_workspace(workspace_id)
workspace.connect()
api_root = resolve_cloud_api_url()
client_id = resolve_cloud_client_id()
client_secret = resolve_cloud_client_secret()

return (
f"✅ Successfully connected to Airbyte Cloud workspace.\n"
f"Workspace ID: {workspace.workspace_id}\n"
f"Workspace URL: {workspace.workspace_url}"
# Get workspace details from the public API
workspace_response = api_util.get_workspace(
workspace_id=workspace.workspace_id,
api_root=api_root,
client_id=client_id,
client_secret=client_secret,
)

return CloudWorkspaceResult(
id=workspace_response.workspace_id,
name=workspace_response.name,
organization_id="", # Not available from public API without expensive lookup
organization_name=None, # Not available from public API without expensive lookup
)


Expand Down