Skip to content
Merged
Changes from 1 commit
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
20 changes: 17 additions & 3 deletions airbyte/mcp/cloud_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from airbyte.cloud.constants import FAILED_STATUSES
from airbyte.cloud.workspaces import CloudWorkspace
from airbyte.destinations.util import get_noop_destination
from airbyte.exceptions import AirbyteMissingResourceError, PyAirbyteInputError
from airbyte.exceptions import AirbyteError, AirbyteMissingResourceError, PyAirbyteInputError
from airbyte.mcp._tool_utils import (
check_guid_created_in_session,
mcp_tool,
Expand Down Expand Up @@ -485,12 +485,26 @@ def check_airbyte_cloud_workspace(
client_secret=client_secret,
)

# Try to get organization info, but fail gracefully if we don't have permissions.
# Fetching organization info requires ORGANIZATION_READER permissions on the organization,
# which may not be available with workspace-scoped credentials.
organization_id: str | None = None
organization_name: str | None = None
try:
organization_id = workspace.organization_id
organization_name = workspace.organization_name
except AirbyteError:
# If we can't fetch organization info (e.g., due to insufficient permissions),
# we'll just omit these fields rather than failing the entire check.
pass

return CloudWorkspaceResult(
workspace_id=workspace_response.workspace_id,
workspace_name=workspace_response.name,
workspace_url=workspace.workspace_url,
organization_id=workspace.organization_id or "[error: organization ID not discovered]",
organization_name=workspace.organization_name,
organization_id=organization_id
or "[unavailable - requires ORGANIZATION_READER permission]",
organization_name=organization_name,
)


Expand Down