Skip to content

feat(mcp): Add organization info to check_airbyte_cloud_workspace tool#897

Merged
Aaron ("AJ") Steers (aaronsteers) merged 9 commits intomainfrom
devin/1765226177-mcp-check-workspace-org-info
Dec 9, 2025
Merged

feat(mcp): Add organization info to check_airbyte_cloud_workspace tool#897
Aaron ("AJ") Steers (aaronsteers) merged 9 commits intomainfrom
devin/1765226177-mcp-check-workspace-org-info

Conversation

@aaronsteers
Copy link
Member

@aaronsteers Aaron ("AJ") Steers (aaronsteers) commented Dec 8, 2025

Summary

Updates the check_airbyte_cloud_workspace MCP tool to return organization ID and name alongside workspace information. This helps users who don't know their organization ID.

Changes:

  • Added get_workspace_organization_info() function in api_util.py that calls the Config API endpoint POST /v1/workspaces/get_organization_info for an efficient O(1) lookup
  • Updated CloudWorkspaceResult model to include organization_name field
  • Changed check_airbyte_cloud_workspace return type from str to CloudWorkspaceResult with structured data

Updates since last revision:

  • Replaced the brute-force approach (iterating through all organizations/workspaces) with a direct Config API call after discovering the /v1/workspaces/get_organization_info endpoint in the OpenAPI spec
  • This addresses the performance concern raised in review - the new implementation is O(1) instead of O(n*m)
  • Renamed CloudWorkspaceResult fields from id/name to workspace_id/workspace_name for clarity
  • Added descriptive error message [error: organization ID not discovered] when organization ID lookup fails

Review & Testing Checklist for Human

  • Breaking change: Return type changed from str to CloudWorkspaceResult. Verify this doesn't break existing MCP tool consumers.
  • Config API availability: The endpoint POST /v1/workspaces/get_organization_info is used. Verify this endpoint is available in all target Airbyte Cloud environments.
  • Workspace URL removed: The old implementation returned workspace_url but the new one doesn't. Verify this isn't needed by consumers.
  • Test manually: Call the check_airbyte_cloud_workspace MCP tool with valid credentials and verify it returns the expected organization info (organizationId and organizationName).

Notes

Summary by CodeRabbit

  • New Features

    • Workspace info now surfaces workspace URL and organization name alongside explicit workspace identifiers.
  • Refactor

    • Workspace checks now return structured workspace details assembled from the platform API instead of a plain message.
  • Performance

    • Organization info for a workspace is cached to reduce repeated lookups and speed subsequent operations.

✏️ Tip: You can customize this high-level summary in your review settings.

Important

Auto-merge enabled.

This PR is set to merge automatically when all requirements are met.

Note

Auto-merge may have been disabled. Please check the PR status to confirm.

- Add get_workspace_with_org_info function to api_util.py that retrieves
  workspace details including organization ID and name
- Update check_airbyte_cloud_workspace MCP tool to return CloudWorkspaceResult
  with workspace ID, workspace name, organization ID, and organization name
- Add organization_name field to CloudWorkspaceResult model

Co-Authored-By: AJ Steers <aj@airbyte.io>
@devin-ai-integration
Copy link
Contributor

Original prompt from AJ Steers
Received message in Slack channel #ask-devin-ai:

@Devin - Check the PyAirbyte Coral MCP tools - specifically the "check workspace" MCP tool. Can you see if it is possible for that tool to also return the organization ID that the workspace belongs to (and the name too if available)? This will help users who don't know there organization ID. While we're at it, we can return a workspace name if available as well.

If you find a path forward, go ahead and create the PR. Lmk if you need help or get stuck.
Thread URL: https://airbytehq-team.slack.com/archives/C08BHPUMEPJ/p1765226026855169

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

Testing This PyAirbyte Version

You can test this version of PyAirbyte using the following:

# Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1765226177-mcp-check-workspace-org-info' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1765226177-mcp-check-workspace-org-info'

Helpful Resources

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /fix-pr - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test-pr - Runs tests with the updated PyAirbyte

Community Support

Questions? Join the #pyairbyte channel in our Slack workspace.

📝 Edit this welcome message.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 8, 2025

📝 Walkthrough

Walkthrough

Replaces string-based workspace checks with a structured CloudWorkspaceResult (renamed fields, added optional workspace_url and organization_name). check_airbyte_cloud_workspace now resolves credentials, calls api_util.get_workspace and api_util.get_workspace_organization_info, and returns a populated CloudWorkspaceResult. cloud workspace model caches organization info.

Changes

Cohort / File(s) Summary
Cloud workspace validation
airbyte/mcp/cloud_ops.py
Renamed CloudWorkspaceResult fields (idworkspace_id, nameworkspace_name); added `workspace_url: str
Config API helper
airbyte/_util/api_util.py
Added get_workspace_organization_info(workspace_id: str, *, api_root: str, client_id: SecretString, client_secret: SecretString) -> dict[str, Any] which POSTs to /workspaces/get_organization_info via _make_config_api_request and returns the API response for an O(1) organization lookup.
Cloud workspace model
airbyte/cloud/workspaces.py
Added cached property _organization_info and public properties organization_id and organization_name on CloudWorkspace to fetch and cache organization details via the new API helper.
Manifest
manifest.json (or similar)
Updated manifest metadata (file referenced in summary).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Caller
  participant CloudOps as CloudOps.check_airbyte_cloud_workspace
  participant APIUtil as APIUtil
  participant ConfigAPI as Config API

  Caller->>CloudOps: check_airbyte_cloud_workspace(workspace_id, ...)
  CloudOps->>CloudOps: resolve api_root, client_id, client_secret
  CloudOps->>APIUtil: get_workspace(workspace_id, api_root, client_id, client_secret)
  APIUtil->>ConfigAPI: GET /workspaces/{id}
  ConfigAPI-->>APIUtil: 200 OK (workspace data)
  APIUtil-->>CloudOps: workspace dict
  CloudOps->>APIUtil: get_workspace_organization_info(workspace_id, api_root, client_id, client_secret)
  APIUtil->>ConfigAPI: POST /workspaces/get_organization_info { "workspaceId": workspace_id }
  ConfigAPI-->>APIUtil: 200 OK (organization data)
  APIUtil-->>CloudOps: org info dict
  CloudOps->>CloudOps: assemble CloudWorkspaceResult(workspace_id, workspace_name, workspace_url, organization_id, organization_name)
  CloudOps-->>Caller: CloudWorkspaceResult
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Files to focus review on:
    • airbyte/mcp/cloud_ops.py — confirm callsites and consumers accept the new CloudWorkspaceResult shape and renamed fields; should we search/update usages to avoid regressions?
    • airbyte/_util/api_util.py — validate request payload, auth usage, error handling and response shape mapping for get_workspace_organization_info; wdyt?
    • airbyte/cloud/workspaces.py — ensure cached_property semantics and caching lifecycle are appropriate for expected usage; any concerns?

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main change: adding organization info to the check_airbyte_cloud_workspace MCP tool, which aligns with the core changes in the PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1765226177-mcp-check-workspace-org-info

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…space info

Addresses review feedback: The previous implementation iterated through all
organizations and workspaces which would fail at scale for Airbyte team members
with access to thousands of customer workspaces.

Changes:
- Remove get_workspace_with_org_info function from api_util.py
- Update check_airbyte_cloud_workspace to use existing get_workspace API
- Return workspace ID and name from public API
- Set organization_id/organization_name to empty/None (not available from
  public API without expensive lookup)

Co-Authored-By: AJ Steers <aj@airbyte.io>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 663ba4d and 023f30f.

📒 Files selected for processing (1)
  • airbyte/mcp/cloud_ops.py (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
airbyte/mcp/cloud_ops.py (3)
airbyte/cloud/workspaces.py (1)
  • CloudWorkspace (64-651)
airbyte/cloud/auth.py (3)
  • resolve_cloud_api_url (25-33)
  • resolve_cloud_client_id (17-22)
  • resolve_cloud_client_secret (9-14)
airbyte/_util/api_util.py (1)
  • get_workspace (100-127)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.10, Windows)
  • GitHub Check: Pytest (No Creds)
🔇 Additional comments (3)
airbyte/mcp/cloud_ops.py (3)

474-485: Good decision to use direct workspace lookup instead of expensive organization iteration.

The implementation correctly resolves credentials and calls api_util.get_workspace() directly, which avoids the performance concern mentioned in the PR objectives about iterating through all organizations and workspaces. This is a much more efficient approach for the common case.


161-162: Consider documenting that organization_name is currently unavailable or defer field addition.

The organization_name field is a useful addition to the model, but if the implementation cannot populate it (due to API constraints), clarify this in the field's docstring or defer adding the field until organization data is actually available. Leaving unpopulated fields can create confusion for users who see them in the model but never receive values.


468-468: Return type change improves API with structured data.

The function now returns CloudWorkspaceResult instead of a string, providing structured workspace information (id, name, organization details). Since MCP tools operate through JSON-RPC serialization via FastMCP, Pydantic models are natively supported and serialize cleanly to JSON. This is not a breaking change for MCP consumers—it's an improvement that provides more useful, well-defined data instead of an unstructured string.

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

PyTest Results (Fast Tests Only, No Creds)

348 tests  ±0   348 ✅ ±0   5m 47s ⏱️ -10s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit a7a0331. ± Comparison against base commit 69f6c96.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

PyTest Results (Full)

416 tests  ±0   399 ✅  - 1   26m 6s ⏱️ -13s
  1 suites ±0    16 💤 ±0 
  1 files   ±0     1 ❌ +1 

For more details on these failures, see this check.

Results for commit a7a0331. ± Comparison against base commit 69f6c96.

♻️ This comment has been updated with latest results.

Found the /v1/workspaces/get_organization_info Config API endpoint which
provides an efficient O(1) lookup to get organization info for a workspace.

Changes:
- Add get_workspace_organization_info function to api_util.py that calls
  the Config API endpoint POST /workspaces/get_organization_info
- Update check_airbyte_cloud_workspace to use the new function to return
  organization_id and organization_name

This replaces the previous brute-force approach that would have iterated
through all organizations and workspaces.

Co-Authored-By: AJ Steers <aj@airbyte.io>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
airbyte/mcp/cloud_ops.py (1)

459-499: Workspace URL no longer surfaced from this tool; still acceptable?

The updated implementation returns a structured CloudWorkspaceResult but does not expose a workspace_url field, so consumers lose the direct link that older string responses included. Since we already have workspace: CloudWorkspace in scope, would it be worth adding a workspace_url field to CloudWorkspaceResult and setting it from workspace.workspace_url to preserve that affordance for agents, or are we intentionally dropping it here, wdyt?

🧹 Nitpick comments (3)
airbyte/_util/api_util.py (1)

1677-1710: New Config API helper looks consistent; consider tightening the contract?

The helper is nicely aligned with the existing _make_config_api_request pattern and solves the O(1) lookup need. Would it be worth either (a) documenting in the docstring that this can raise AirbyteError on non-2xx responses, or (b) in the future, wrapping the raw dict[str, Any] in a small typed model so callers don’t rely on magic keys like "organizationId" / "organizationName" everywhere, wdyt?

airbyte/mcp/cloud_ops.py (2)

152-162: CloudWorkspaceResult shape now includes organization_name; confirm expectations around organization_id emptiness?

Nice addition making organization_name optional so we can populate it where available. Given that some callers (like check_airbyte_cloud_workspace) now have a reliable organizationId and others may not, do we still expect organization_id to be strictly non-empty, or should we consider allowing str | None there as well so “unknown” is explicitly represented instead of "", wdyt?


459-499: check_airbyte_cloud_workspace now does real org lookup; consider failure behavior and consumer impact?

The new flow (public API workspace fetch + Config API get_organization_info + structured CloudWorkspaceResult) looks good and fixes the earlier brute-force concern.

Two follow-ups to consider:

  1. Failure behavior for org lookup: Right now, if /workspaces/get_organization_info fails (auth, permissions, feature flag, etc.), the whole tool fails. For a “check connectivity + basic info” tool, would you prefer to catch AirbyteError around get_workspace_organization_info and still return workspace id/name with organization_id/organization_name left unset, so users don’t lose the basic check when org metadata is unavailable, wdyt?
  2. Breaking return type change: Since the tool now returns CloudWorkspaceResult instead of a str, have we confirmed that all MCP consumers of check_airbyte_cloud_workspace are prepared to handle the structured result (and that any prompt templates / expectations of a plain string were updated), wdyt?
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 023f30f and fe7f991.

📒 Files selected for processing (2)
  • airbyte/_util/api_util.py (1 hunks)
  • airbyte/mcp/cloud_ops.py (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-11T19:53:44.427Z
Learnt from: yohannj
Repo: airbytehq/PyAirbyte PR: 716
File: airbyte/logs.py:384-402
Timestamp: 2025-07-11T19:53:44.427Z
Learning: In the PyAirbyte project, when reviewing PRs, maintain clear separation of concerns. Don't suggest changes that are outside the scope of the PR's main objective, even if they would improve consistency or fix other issues. This helps with reviewing changes and potential reverts.

Applied to files:

  • airbyte/mcp/cloud_ops.py
🧬 Code graph analysis (1)
airbyte/_util/api_util.py (1)
airbyte/secrets/base.py (1)
  • SecretString (38-143)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Windows)
  • GitHub Check: Pytest (No Creds)

…kspace_name

Per review feedback, use more explicit field names:
- id -> workspace_id
- name -> workspace_name

Co-Authored-By: AJ Steers <aj@airbyte.io>
devin-ai-integration bot and others added 3 commits December 8, 2025 22:21
Per review feedback, use '[error: organization ID not discovered]' instead of empty string when organization ID is not found.

Co-Authored-By: AJ Steers <aj@airbyte.io>
…CloudWorkspace

- Added cached_property _organization_info that fetches org info via Config API
- Added organization_id and organization_name properties that use the cached result
- Updated check_airbyte_cloud_workspace MCP tool to use CloudWorkspace properties
  instead of calling get_workspace_organization_info directly

Co-Authored-By: AJ Steers <aj@airbyte.io>
…k error)

Co-Authored-By: AJ Steers <aj@airbyte.io>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
airbyte/mcp/cloud_ops.py (1)

459-491: Implementation uses indirect API calls via CloudWorkspace properties; verify breaking change consumer impact.

The function correctly fetches workspace details and organization info through CloudWorkspace properties. The organization_id and organization_name properties internally call the get_workspace_organization_info endpoint (POST /v1/workspaces/get_organization_info) via a cached property, ensuring efficient lookups.

The return type has changed from str to CloudWorkspaceResult. Please confirm:

  1. Breaking change: All MCP consumers have been updated to handle the structured CloudWorkspaceResult response instead of the previous string format.
🧹 Nitpick comments (1)
airbyte/mcp/cloud_ops.py (1)

152-162: Model changes look good; consider organization_id type and workspace_url.

The field renames to workspace_id and workspace_name improve clarity, and the new organization_name field is properly typed as optional. A couple of points to consider:

  1. workspace_url removal: Past review comments noted that the previous implementation returned workspace_url, but it's not included in this model. The CloudWorkspace class has a workspace_url property that could be included here. The PR objectives mention verifying this removal is acceptable—have you confirmed with MCP consumers that they don't need the URL, wdyt?

  2. organization_id type: The field is typed as str (not str | None), but workspace.organization_id can return None. The implementation handles this with the fallback string "[error: organization ID not discovered]", but semantically it's a bit unusual to have an error message as a valid ID value. Would it be cleaner to make organization_id: str | None and let consumers handle None explicitly?

Based on past review comments, this was previously discussed. Have the concerns been resolved?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56300d2 and 5e38b41.

📒 Files selected for processing (2)
  • airbyte/cloud/workspaces.py (2 hunks)
  • airbyte/mcp/cloud_ops.py (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-11T19:53:44.427Z
Learnt from: yohannj
Repo: airbytehq/PyAirbyte PR: 716
File: airbyte/logs.py:384-402
Timestamp: 2025-07-11T19:53:44.427Z
Learning: In the PyAirbyte project, when reviewing PRs, maintain clear separation of concerns. Don't suggest changes that are outside the scope of the PR's main objective, even if they would improve consistency or fix other issues. This helps with reviewing changes and potential reverts.

Applied to files:

  • airbyte/mcp/cloud_ops.py
🧬 Code graph analysis (1)
airbyte/mcp/cloud_ops.py (3)
airbyte/cloud/workspaces.py (2)
  • organization_id (101-106)
  • organization_name (109-114)
airbyte/cloud/auth.py (3)
  • resolve_cloud_api_url (25-33)
  • resolve_cloud_client_id (17-22)
  • resolve_cloud_client_secret (9-14)
airbyte/_util/api_util.py (1)
  • get_workspace (100-127)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (No Creds)
  • GitHub Check: Pytest (All, Python 3.10, Windows)
  • GitHub Check: Pytest (Fast)
🔇 Additional comments (3)
airbyte/cloud/workspaces.py (3)

39-39: LGTM on the import addition!

The cached_property import is correctly placed and necessary for the organization info caching functionality below.


100-106: Clean implementation of organization_id property!

The property correctly returns str | None and uses .get("organizationId") to safely handle cases where the organization ID isn't available. The caching via _organization_info ensures efficient lookups.


108-114: LGTM on organization_name property!

Consistent implementation with organization_id. The property safely handles missing organization names and leverages the cached lookup.

@aaronsteers
Copy link
Member Author

Devin, I need you to add back the workspace id in the result of the MCP tool. Looks like that got dropped

@devin-ai-integration
Copy link
Contributor

Hi AJ, I just tested the MCP tool locally using poe mcp-tool-test and workspace_id is present in the result:

{
  "workspace_id": "19d7a891-8e0e-40ac-8a8c-5faf8d11e47c",
  "workspace_name": "aj-dataops-demos",
  "organization_id": "664c690e-5263-49ba-b01f-4a6759b3330a",
  "organization_name": "Airbyte Team"
}

Are you perhaps testing against the published PyAirbyte package (v0.33.6) instead of the PR branch? The published version wouldn't have these changes yet.

To test the PR branch, you can use:

poe mcp-tool-test check_airbyte_cloud_workspace '{"workspace_id": "YOUR_WORKSPACE_ID"}'

Or install from the PR branch:

pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1765226177-mcp-check-workspace-org-info'

Let me know if you're seeing something different!

Co-Authored-By: AJ Steers <aj@airbyte.io>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e38b41 and 220ec34.

📒 Files selected for processing (1)
  • airbyte/mcp/cloud_ops.py (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-11T19:53:44.427Z
Learnt from: yohannj
Repo: airbytehq/PyAirbyte PR: 716
File: airbyte/logs.py:384-402
Timestamp: 2025-07-11T19:53:44.427Z
Learning: In the PyAirbyte project, when reviewing PRs, maintain clear separation of concerns. Don't suggest changes that are outside the scope of the PR's main objective, even if they would improve consistency or fix other issues. This helps with reviewing changes and potential reverts.

Applied to files:

  • airbyte/mcp/cloud_ops.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (All, Python 3.10, Windows)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (No Creds)
🔇 Additional comments (1)
airbyte/mcp/cloud_ops.py (1)

470-494: Implementation is correct - CloudWorkspace properties are properly defined.

The structured CloudWorkspaceResult return type is a solid improvement over the previous string return. The implementation correctly combines data from workspace_response (for workspace details) and the workspace object (for URL and organization info).

The workspace.organization_id and workspace.organization_name properties are both defined in CloudWorkspace at lines 36–50 of airbyte/cloud/workspaces.py. Both are implemented as @property decorators that retrieve values from a @cached_property method (_organization_info), which lazily fetches organization data via api_util.get_workspace_organization_info(). Since these properties return str | None, the fallback message "[error: organization ID not discovered]" in the code correctly handles the None case.

One note: The return type change from str to CloudWorkspaceResult is a breaking change for existing MCP tool consumers—this is documented in the PR objectives, so awareness is good.

…esult fields

Co-Authored-By: AJ Steers <aj@airbyte.io>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
airbyte/mcp/cloud_ops.py (2)

461-494: check_airbyte_cloud_workspace behavior and payload look solid; two tiny polish ideas

The new implementation cleanly:

  • Resolves credentials,
  • Verifies the workspace via the API,
  • Returns a structured CloudWorkspaceResult including URL and org info (with a clear fallback string when org lookup fails).

Functionally this looks good to ship. Two minor follow‑ups you might consider:

  1. The docstring (Line 473) only calls out ID, name, and org info. Since you now also return workspace_url, would it be helpful to mention that explicitly so tool consumers know it’s available, wdyt?
  2. You resolve api_root, client_id, and client_secret separately from _get_cloud_workspace, even though CloudWorkspace already holds these. Would reusing the values from workspace (for a single source of truth and one fewer env read) be a small simplification worth doing here, or is the explicit re‑resolution intentional, wdyt?

1259-1264: list_cloud_workspaces mapping now matches the updated model; optional enrichment

Using workspace_id= and workspace_name= here fixes the earlier mismatch with the model and should avoid any construction issues; this looks correct to me.

One optional enhancement: if the list_workspaces_in_organization API ever exposes fields that would let you populate workspace_url and/or organization_name without extra round‑trips, would you want to enrich the CloudWorkspaceResult here for parity with check_airbyte_cloud_workspace, or is keeping the list payload minimal an intentional choice, wdyt?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 220ec34 and a7a0331.

📒 Files selected for processing (1)
  • airbyte/mcp/cloud_ops.py (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-11T19:53:44.427Z
Learnt from: yohannj
Repo: airbytehq/PyAirbyte PR: 716
File: airbyte/logs.py:384-402
Timestamp: 2025-07-11T19:53:44.427Z
Learning: In the PyAirbyte project, when reviewing PRs, maintain clear separation of concerns. Don't suggest changes that are outside the scope of the PR's main objective, even if they would improve consistency or fix other issues. This helps with reviewing changes and potential reverts.

Applied to files:

  • airbyte/mcp/cloud_ops.py
🧬 Code graph analysis (1)
airbyte/mcp/cloud_ops.py (3)
airbyte/cloud/workspaces.py (4)
  • workspace_url (83-85)
  • organization_id (101-106)
  • organization_name (109-114)
  • CloudWorkspace (65-681)
airbyte/cloud/auth.py (3)
  • resolve_cloud_api_url (25-33)
  • resolve_cloud_client_id (17-22)
  • resolve_cloud_client_secret (9-14)
airbyte/_util/api_util.py (1)
  • get_workspace (100-127)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Windows)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (No Creds)
🔇 Additional comments (1)
airbyte/mcp/cloud_ops.py (1)

155-164: CloudWorkspaceResult shape looks consistent and expressive

The switch to workspace_id / workspace_name plus optional workspace_url / organization_name lines up nicely with how other result models are structured; I don’t see any functional issues here, and the required organization_id keeps callers’ expectations clear. LGTM from my side.

@aaronsteers Aaron ("AJ") Steers (aaronsteers) merged commit 9de76d2 into main Dec 9, 2025
23 of 25 checks passed
@aaronsteers Aaron ("AJ") Steers (aaronsteers) deleted the devin/1765226177-mcp-check-workspace-org-info branch December 9, 2025 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant