From 693d6a47fa6ed36b42bbd04999bc946d8a7db0c1 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 26 Sep 2026 00:12:07 +0000 Subject: [PATCH 1/2] fix(mcp): surface the SQL passthrough notice in metadata.warnings so MCP renderers show it Co-authored-by: Piotr Kozikowski Co-Authored-By: AJ Steers --- airbyte/_direct_connectors/connector_docs.py | 2 +- tests/unit_tests/test_cloud_describe.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/airbyte/_direct_connectors/connector_docs.py b/airbyte/_direct_connectors/connector_docs.py index ab2d303f3..3402e6a40 100644 --- a/airbyte/_direct_connectors/connector_docs.py +++ b/airbyte/_direct_connectors/connector_docs.py @@ -215,6 +215,7 @@ def build_direct_access_sql_guidance( title=f"{destination.name} (SQL passthrough destination)", summary=f"Table layout and naming for the `{destination.name}` destination.", tags=["destination"], + warnings=[sql_passthrough_notice] if sql_passthrough_notice else [], ) connections = _destination_connections(destination) content: list[dict[str, Any]] = [] @@ -247,7 +248,6 @@ def build_direct_access_sql_guidance( outline=[], section_id=None, content=content, - warnings=[sql_passthrough_notice] if sql_passthrough_notice else [], ) diff --git a/tests/unit_tests/test_cloud_describe.py b/tests/unit_tests/test_cloud_describe.py index 08e9f5566..2a78f1fb7 100644 --- a/tests/unit_tests/test_cloud_describe.py +++ b/tests/unit_tests/test_cloud_describe.py @@ -14,6 +14,10 @@ from airbyte._direct_connectors import api_util as agents_api_util from airbyte._direct_connectors import connector_docs from airbyte.cloud import workspaces as cloud_workspaces +from airbyte.mcp._docs_results import ( + render_agent_skill_docs_result, + render_connector_docs_result, +) from airbyte.cloud.connections import CloudConnection from airbyte.cloud.connectors import ( CloudConnector, @@ -383,7 +387,9 @@ def test_get_direct_access_guidance_destination_not_enabled_adds_notice( notice = connector_docs.SQL_PASSTHROUGH_NOT_ENABLED_NOTICE guidance = destination.get_direct_access_guidance() assert guidance.content[0] == {"type": "paragraph", "text": notice} - assert guidance.warnings == [notice] + assert guidance.metadata.warnings == [notice] + assert render_connector_docs_result(guidance).warnings == [notice] + assert render_agent_skill_docs_result(guidance).warnings == [notice] assert guidance.outline == [] assert any(block.get("type") == "table" for block in guidance.content) assert "execute_external_sql_query" not in _content_text(guidance) @@ -520,7 +526,9 @@ def test_get_direct_access_guidance_destination_no_context_layer_notices( guidance = destination.get_direct_access_guidance() read_docs.assert_not_called() assert guidance.content[0] == {"type": "paragraph", "text": notice} - assert guidance.warnings == [notice] + assert guidance.metadata.warnings == [notice] + assert render_connector_docs_result(guidance).warnings == [notice] + assert render_agent_skill_docs_result(guidance).warnings == [notice] assert guidance.outline == [] assert "execute_external_sql_query" not in _content_text(guidance) assert "SHOW TABLES" not in _content_text(guidance) From 52fbb3278695c4f172d38134b8306ebddd7bcee0 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 28 Sep 2026 04:18:55 +0000 Subject: [PATCH 2/2] refactor(mcp): rename sql_passthrough_notice kwarg to sql_passthrough_warning Co-authored-by: Piotr Kozikowski Co-Authored-By: AJ Steers --- airbyte/_direct_connectors/connector_docs.py | 8 ++++---- airbyte/cloud/connectors.py | 4 ++-- tests/unit_tests/test_mcp_cloud.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/airbyte/_direct_connectors/connector_docs.py b/airbyte/_direct_connectors/connector_docs.py index 3402e6a40..d9dda8b28 100644 --- a/airbyte/_direct_connectors/connector_docs.py +++ b/airbyte/_direct_connectors/connector_docs.py @@ -204,7 +204,7 @@ def _destination_connections(destination: _DestinationLike) -> list[_ConnectionL def build_direct_access_sql_guidance( destination: _DestinationLike, *, - sql_passthrough_notice: str | None = None, + sql_passthrough_warning: str | None = None, ) -> DirectAccessGuidance: """Build standalone sql guidance when there is no associated skill.""" dialect = _SQL_PASSTHROUGH_DESTINATION_DIALECTS[destination.definition_id] @@ -215,12 +215,12 @@ def build_direct_access_sql_guidance( title=f"{destination.name} (SQL passthrough destination)", summary=f"Table layout and naming for the `{destination.name}` destination.", tags=["destination"], - warnings=[sql_passthrough_notice] if sql_passthrough_notice else [], + warnings=[sql_passthrough_warning] if sql_passthrough_warning else [], ) connections = _destination_connections(destination) content: list[dict[str, Any]] = [] - if sql_passthrough_notice: - content.append({"type": "paragraph", "text": sql_passthrough_notice}) + if sql_passthrough_warning: + content.append({"type": "paragraph", "text": sql_passthrough_warning}) content += _destination_layout_blocks( destination=destination, dialect=dialect, diff --git a/airbyte/cloud/connectors.py b/airbyte/cloud/connectors.py index b938bc752..786e2370d 100644 --- a/airbyte/cloud/connectors.py +++ b/airbyte/cloud/connectors.py @@ -699,7 +699,7 @@ def get_direct_access_guidance(self, *, section: str | None = None) -> DirectAcc ) return connector_docs.build_direct_access_sql_guidance( destination, - sql_passthrough_notice=connector_docs.SQL_PASSTHROUGH_UNAVAILABLE_NOTICE, + sql_passthrough_warning=connector_docs.SQL_PASSTHROUGH_UNAVAILABLE_NOTICE, ) skill_id = connector_docs.destination_skill_id(self.connector_id) try: @@ -716,7 +716,7 @@ def get_direct_access_guidance(self, *, section: str | None = None) -> DirectAcc raise return connector_docs.build_direct_access_sql_guidance( destination, - sql_passthrough_notice=connector_docs.SQL_PASSTHROUGH_NOT_ENABLED_NOTICE, + sql_passthrough_warning=connector_docs.SQL_PASSTHROUGH_NOT_ENABLED_NOTICE, ) return connector_docs.merge_destination_skill_docs(server_docs, destination) diff --git a/tests/unit_tests/test_mcp_cloud.py b/tests/unit_tests/test_mcp_cloud.py index 9841f2d34..591fd9a0d 100644 --- a/tests/unit_tests/test_mcp_cloud.py +++ b/tests/unit_tests/test_mcp_cloud.py @@ -1666,7 +1666,7 @@ def test_describe_helper_fallback_guidance_names_no_tools() -> None: connector = _DescribedConnector(connector_type=ConnectorType.DESTINATION) connector.guidance = connector_docs.build_direct_access_sql_guidance( destination, - sql_passthrough_notice=connector_docs.SQL_PASSTHROUGH_NOT_ENABLED_NOTICE, + sql_passthrough_warning=connector_docs.SQL_PASSTHROUGH_NOT_ENABLED_NOTICE, ) result = _describe(connector, with_direct_access_guidance=True)