Skip to content

fix(mcp): return direct-access enablement link from skill docs and rename tool to get_external_access_skill_docs - #1422

Merged
Aaron ("AJ") Steers (aaronsteers) merged 3 commits into
release-candidate/v1from
devin/1792977916-skill-docs-enablement-link
Oct 26, 2026
Merged

Aaron ("AJ") Steers (aaronsteers) merged 3 commits into
release-candidate/v1from
devin/1792977916-skill-docs-enablement-link

Conversation

@aaronsteers

@aaronsteers Aaron ("AJ") Steers (aaronsteers) commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #1421. Requested by AJ Steers (Aaron ("AJ") Steers (@aaronsteers)).

Agents usually call the skill-docs tool before execute_external_api_query, so it's often where a user first hits disabled direct access. Until now it raised the bare AirbyteExternalAccessNotEnabledError: no link, and guidance about enabled_features, a field users can't see. It now returns the same message the execute_external_* tools return:

errors: ["Show the user this message as-is: Direct access is currently disabled for GitHub. [Click here](<connector_url>/enable-direct-access?skip-consent-screen=false) to enable it."]

Breaking for MCP clients: tool rename. The MCP tool get_agent_skill_docs is now get_external_access_skill_docs, so its name matches the execute_external_* tools it documents and the external_access tool category. Arguments (docs_skill_id, connector_id, section, workspace_id) are unchanged. There is no alias, so clients that hard-code the old name break. AgentSkillDocsResult / render_agent_skill_docs_result become ExternalAccessSkillDocsResult / render_external_access_skill_docs_result. The Python API (CloudWorkspace.get_agent_skill_docs, CloudConnector.read_agent_skill_docs) keeps its names.

Changes:

  • CloudConnector.read_agent_skill_docs: sources now read connector-source:<id> directly. The old path first ran an unscoped inspect probe of the same skill ID, then raised with no URL. Agents API errors go through _raise_if_feature_not_enabled(..., DIRECT_ACCESS, enablement_url=self._direct_access_enablement_url), the same as _execute_direct_action. A real not-enabled 403/404 therefore raises with enablement_url, plus organization_enablement_url when known. If access turns out to be enabled, the original error is re-raised. With no Context layer API, it still raises without a URL.
  • CloudWorkspace.get_agent_skill_docs: connector-source: skill IDs now go through get_source(...).read_agent_skill_docs(...), as connector-destination: IDs already did. Previously the raw Agents API 403/404 came back as a plain AirbyteCloudApiError.
  • get_external_access_skill_docs MCP tool: catches AirbyteExternalAccessNotEnabledError.
    • When enablement_url is set, it returns ExternalAccessSkillDocsResult(content="", errors=[...]). The message comes from the new _direct_access_disabled_message helper, which is now shared with _direct_access_disabled_result.
    • The connector label in that message goes through redact_agent_text, because a returned result skips AgentErrorTextMiddleware. The enablement URL is not redacted, so it keeps its query string.
    • Without a URL it re-raises, as the execute_external_* tools do.
  • ExternalAccessSkillDocsResult gains errors: list[str].

Tests: added unit tests for the not-enabled, enabled-but-forbidden, no-Context-layer and success paths of read_agent_skill_docs, for connector-source: delegation, and for the MCP tool returning the link, redacting the label, or re-raising. Targeted unit suites, ruff and pyrefly pass locally. Not yet tested against a live Cloud workspace. Cloud MCP evals need a matching change in cloud-mcp-evals, because two regression scenarios list the old tool name.

Link to Devin session: https://app.devin.ai/sessions/674dbb1ce8fc4307bb9b0c4979833f46
Open in Devin Desktop: https://app.devin.ai/desktop/session/674dbb1ce8fc4307bb9b0c4979833f46?variant=devin

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

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/1792977916-skill-docs-enablement-link' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1792977916-skill-docs-enablement-link'

PR Slash Commands

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

  • /fix-pr - Fixes most formatting and linting issues
  • /uv-lock - Updates uv.lock file
  • /test-pr - Runs tests with the updated PyAirbyte
  • /prerelease - Builds and publishes a prerelease version to PyPI
  • /evals - Runs the Cloud MCP evals that use the MCP tools this PR changed (/evals full=true runs the full suite)
📚 Show Repo Guidance

Helpful Resources

Community Support

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

📝 Edit this welcome message.

@github-code-quality

github-code-quality Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: Python

Python / code-coverage/pytest-no-creds

release-candidate/v1 d9f652f devin/1792977916-ski... fe3f140 +/-
65% 80% +15%
View coverage of the 10 most impacted files.
File release-candidate/v1 d9f652f devin/1792977916-ski... fe3f140 +/-
airbyte/_util/api_util.py 36% 67% +31%
airbyte/mcp/cloud.py 52% 85% +33%
airbyte/cloud/connectors.py 34% 79% +45%
airbyte/mcp/_datadog.py 0% 50% +50%
airbyte/mcp/_telemetry.py 0% 94% +94%
airbyte/cloud/c...lder/project.py 0% 94% +94%
airbyte/_direct...ctors/models.py 0% 95% +95%
airbyte/mcp/_sso_auth.py 0% 96% +96%
airbyte/cloud/models.py 0% 97% +97%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%

Python / code-coverage/pytest

release-candidate/v1 d9f652f devin/1792977916-ski... fe3f140 +/-
71% 82% +11%
View coverage of the 10 most impacted files.
File release-candidate/v1 d9f652f devin/1792977916-ski... fe3f140 +/-
airbyte/cloud/connectors.py 51% 82% +31%
airbyte/mcp/cloud.py 52% 85% +33%
airbyte/mcp/_datadog.py 0% 50% +50%
airbyte/mcp/_user_identity.py 0% 93% +93%
airbyte/mcp/_telemetry.py 0% 94% +94%
airbyte/cloud/c...lder/project.py 0% 94% +94%
airbyte/_direct...ctors/models.py 0% 95% +95%
airbyte/mcp/_sso_auth.py 0% 96% +96%
airbyte/cloud/models.py 0% 97% +97%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%

Python / code-coverage/pytest-unit

release-candidate/v1 devin/1792977916-ski... fe3f140 +/-
— 77% —

Line coverage data for the release-candidate/v1 branch is not yet available.

View coverage of the 10 most covered files.
File release-candidate/v1 devin/1792977916-ski... fe3f140 +/-
airbyte/cloud/models.py — 97% —
airbyte/mcp/_sso_auth.py — 96% —
airbyte/_direct...ctors/models.py — 95% —
airbyte/cloud/client.py — 90% —
airbyte/exceptions.py — 90% —
airbyte/mcp/cloud.py — 85% —
airbyte/progress.py — 80% —
airbyte/cloud/connectors.py — 79% —
airbyte/shared/...ql_processor.py — 68% —
airbyte/_util/api_util.py — 67% —

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 26, 2026 17:07 UTC

@aaronsteers
Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review October 26, 2026 01:42
Copilot AI balanced review requested due to automatic review settings October 26, 2026 01:42

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new structured error response exposes credentials embedded in connector labels without redaction.

1 open issue
What changed in this PR

This PR addresses #1421 by making get_agent_skill_docs return a direct-access enablement link, consistent with the external query tools.

Changes:

  • Route source skill lookups through connector-level error handling.
  • Return structured errors using a shared disabled-access message.
  • Add regression coverage for enablement links, successful reads, and preserved exceptions.
File Description
tests/​unit_tests/​test_mcp_cloud.py Tests enablement-link responses and re-raising without a URL.
tests/​unit_tests/​test_cloud_guidance.py Tests source skill ID delegation.
tests/​unit_tests/​test_cloud_direct_execute.py Covers disabled access, unrelated errors, API availability, and successful reads.
tests/​unit_tests/​test_cloud_describe.py Updates assertions to require the enablement URL.
airbyte/​mcp/​guidance.py Returns structured disabled-access errors from the docs tool.
airbyte/​mcp/​cloud.py Extracts the shared disabled-access message helper.
airbyte/​mcp/​_docs_results.py Adds an errors field to skill documentation results.
airbyte/​cloud/​workspaces.py Delegates source skill IDs to connector documentation reads.
airbyte/​cloud/​connectors.py Reads source skills directly and translates disabled-access errors.

Review effort: Balanced

Comment thread airbyte/mcp/cloud.py Outdated
devin-ai-integration Bot and others added 2 commits October 26, 2026 01:47
…s_skill_docs

Co-Authored-By: AJ Steers <aj@airbyte.io>
@devin-ai-integration devin-ai-integration Bot changed the title fix(mcp): return direct-access enablement link from get_agent_skill_docs fix(mcp): return direct-access enablement link from skill docs and rename tool to get_external_access_skill_docs Oct 26, 2026
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) merged commit 39c7e90 into release-candidate/v1 Oct 26, 2026
30 checks passed
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) deleted the devin/1792977916-skill-docs-enablement-link branch October 26, 2026 17:08
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.

2 participants