Skip to content

fix(mcp): require source_id on destination search streams - #1388

Merged
Johnny Schmidt (johnny-schmidt) merged 1 commit into
release-candidate/v1from
johnny/mcp-search-source-id-doc
Oct 16, 2026
Merged

Johnny Schmidt (johnny-schmidt) merged 1 commit into
release-candidate/v1from
johnny/mcp-search-source-id-doc

Conversation

@johnny-schmidt

Copy link
Copy Markdown

Summary

An MCP agent searched a destination with streams[] entries that had no source_id. Airbyte Cloud rejected the request with a bare 422 ("The request is invalid or unsupported."), and the agent had no way to tell what was wrong.

The rule: on a destination search, every streams[] entry must include source_id. Only a source search may omit it, and there it must match the searched source if given. Cloud is also gaining a specific source_id_required error; the client-side check fails fast with a clear message either way.

  • execute_external_search_query tool: the docstring and the streams parameter description state the rule.
  • CloudConnector.execute_search_query: raises AirbyteLibInputError before the request when a destination search has a stream without source_id, next to the existing destination_id check.
  • ExternalSearchStreamFilter.source_id docstring updated.

Test plan

  • uv run pytest tests/unit_tests/test_cloud_direct_execute.py tests/unit_tests/test_mcp_cloud.py -k search (new case destination_stream_without_source_id)
  • ruff format --check, ruff check, pyrefly check

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T20:17:39.137968Z 774d66f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@octavia-bot
octavia-bot Bot marked this pull request as draft October 15, 2026 19:27
@octavia-bot

octavia-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

Note

📝 PR Converted to Draft

More info...

Thank you for creating this PR. As a policy to protect our engineers' time, Airbyte requires all PRs to be created first in draft status. Your PR has been automatically converted to draft status in respect for this policy.

As soon as your PR is ready for formal review, you can proceed to convert the PR to "ready for review" status by clicking the "Ready for review" button at the bottom of the PR page.

To skip draft status in future PRs, please include [ready] in your PR title or add the skip-draft-status label when creating your PR.

@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@johnny/mcp-search-source-id-doc' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@johnny/mcp-search-source-id-doc'

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
📚 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 15, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: Python

Python / code-coverage/pytest-no-creds

release-candidate/v1 d9f652f johnny/mcp-search-so... 774d66f +/-
65% 79% +14%
View coverage of the 10 most impacted files.
File release-candidate/v1 d9f652f johnny/mcp-search-so... 774d66f +/-
airbyte/mcp/cloud.py 52% 84% +32%
airbyte/_util/api_util.py 36% 68% +32%
airbyte/cloud/connectors.py 34% 76% +42%
airbyte/mcp/_datadog.py 0% 50% +50%
airbyte/mcp/_user_identity.py 0% 93% +93%
airbyte/mcp/_telemetry.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 johnny/mcp-search-so... 774d66f +/-
71% 81% +10%
View coverage of the 10 most impacted files.
File release-candidate/v1 d9f652f johnny/mcp-search-so... 774d66f +/-
airbyte/cloud/connectors.py 51% 80% +29%
airbyte/mcp/cloud.py 52% 84% +32%
airbyte/mcp/_datadog.py 0% 50% +50%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/mcp/_user_identity.py 0% 93% +93%
airbyte/mcp/_telemetry.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 johnny/mcp-search-so... 774d66f +/-
— 76% —

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 johnny/mcp-search-so... 774d66f +/-
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 — 89% —
airbyte/mcp/cloud.py — 84% —
airbyte/progress.py — 80% —
airbyte/cloud/connectors.py — 76% —
airbyte/_util/api_util.py — 68% —
airbyte/shared/...ql_processor.py — 68% —

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


Updated October 15, 2026 19:37 UTC

@johnny-schmidt

Copy link
Copy Markdown
Author

(agent)

Reviewed head 774d66fcc915003d96fa9995db145a184503df05. No actionable P0–P2 finding.

Failure modes checked: omitted/null source_id on destination selectors is rejected after exclude_none normalization; mixed valid/invalid selectors fail before HTTP; omitted/empty streams and source-level selectors remain accepted. MCP delegates to this same method after list resolution.

Validation: PASS: 8 focused selector cases against actual PR method/model AST; HTTP boundary stubbed (exit 0). This is an isolated behavior check, not the full PyAirbyte test suite.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving to unblock when ready.

@johnny-schmidt
Johnny Schmidt (johnny-schmidt) marked this pull request as ready for review October 16, 2026 20:16
@johnny-schmidt
Johnny Schmidt (johnny-schmidt) merged commit 70dfec7 into release-candidate/v1 Oct 16, 2026
32 checks passed
@johnny-schmidt
Johnny Schmidt (johnny-schmidt) deleted the johnny/mcp-search-source-id-doc branch October 16, 2026 20:16
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