feat(mcp): Add list_cloud_sync_jobs tool with pagination support#902
Merged
Aaron ("AJ") Steers (aaronsteers) merged 6 commits intomainfrom Dec 10, 2025
Merged
Conversation
- Add offset and order_by parameters to api_util.get_job_logs - Add CloudConnection.list_sync_jobs method with pagination support - Add new MCP tool list_cloud_sync_jobs with parameters: - max_jobs: Maximum number of jobs to return (default 20, 0 = no limit) - jobs_offset: Number of jobs to skip from the beginning - from_tail: Order jobs newest-first (True) or oldest-first (False) - Add SyncJobResult and SyncJobListResult Pydantic models for structured output - Validation: Cannot combine jobs_offset with from_tail=True - Default behavior: from_tail=True (newest jobs first) Co-Authored-By: aldo.gonzalez@airbyte.io <aldo.gonzalez@airbyte.io>
Contributor
Author
Original prompt from aldo.gonzalez@airbyte.io |
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Testing This PyAirbyte VersionYou 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/1765393451-add-job-pagination' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1765393451-add-job-pagination'Helpful ResourcesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
Community SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
…ethods Co-Authored-By: aldo.gonzalez@airbyte.io <aldo.gonzalez@airbyte.io>
…ve list_sync_jobs Co-Authored-By: aldo.gonzalez@airbyte.io <aldo.gonzalez@airbyte.io>
Co-Authored-By: aldo.gonzalez@airbyte.io <aldo.gonzalez@airbyte.io>
PyTest Results (Full)416 tests ±0 399 ✅ - 1 24m 45s ⏱️ -30s Results for commit dd19947. ± Comparison against base commit 1b48476. This pull request skips 1 test.♻️ This comment has been updated with latest results. |
…issue Co-Authored-By: aldo.gonzalez@airbyte.io <aldo.gonzalez@airbyte.io>
Co-Authored-By: aldo.gonzalez@airbyte.io <aldo.gonzalez@airbyte.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new MCP tool
list_cloud_sync_jobsthat enables pagination through sync job history for a connection. This addresses the issue where Devin could only retrieve the "latest" job and couldn't browse historical syncs.Changes:
offsetandorder_byparameters toapi_util.get_job_logs()CloudConnection.get_previous_sync_logs()with full pagination support (limit,offset,from_tail)JOB_ORDER_BY_CREATED_AT_DESCandJOB_ORDER_BY_CREATED_AT_ASCconstants toapi_util.pylist_cloud_sync_jobswith parameters:max_jobs: Maximum jobs to return (default 20, capped at 500)jobs_offset: Number of jobs to skipfrom_tail: Order newest-first (True) or oldest-first (False)SyncJobResultandSyncJobListResultPydantic modelsThe design follows the pattern established in PR #888 for log pagination.
Updates Since Last Revision
get_previous_sync_logs()per code review feedbacklist_sync_jobs()method to avoid having two ways of doing the same thingSyncResultobjects (job metadata), not actual log textmax_jobsat 500 to avoid overloading agent context (per AJ's feedback)max_jobs <= 0, it now defaults to 20limitchanged from 10 to 20 to align with MCP tool defaultsReview & Testing Checklist for Human
get_previous_sync_logs()defaultlimitchanged from 10 to 20. Confirm this is acceptable for existing callers (e.g.,get_sync_result()still passeslimit=1explicitly, so it's unaffected).createdAt|DESCby default. Confirm this matches the previous implicit API behavior.max_jobsis now capped at 500 and defaults to 20 if <= 0. Confirm this behavior is acceptable.acb716fc-93c9-448b-bc81-74f349bbf60a- verified jobs returned in correct order, offset pagination works, andfrom_tail=Falsereturns oldest-firstjobs_offsetandfrom_tail=TrueraisesPyAirbyteInputErrorSuggested test plan: Use the MCP tool via
poe mcpto calllist_cloud_sync_jobson a connection with historical jobs and verify pagination works as expected.Notes
get_previous_sync_logsis now the single method for listing sync jobs with pagination supportRequested by: aldo.gonzalez@airbyte.io
Link to Devin run: https://app.devin.ai/sessions/b70da243df1d4ae39831615a1d93bd59
Important
Auto-merge enabled.
This PR is set to merge automatically when all requirements are met.