-
Notifications
You must be signed in to change notification settings - Fork 67
fix(mcp): resolve nested anyOf
in MCP tool args
#794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(mcp): resolve nested anyOf
in MCP tool args
#794
Conversation
… construct (arg now not strictly optional by Python standards)
👋 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@aj/fix/resolve-nested-anyof-in-mcp-tool-args' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@aj/fix/resolve-nested-anyof-in-mcp-tool-args' Helpful ResourcesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
Community SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
anyOf
in MCP tool args
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue with nested anyOf
handling in MCP tool arguments by restructuring function parameter definitions. The change refactors optional function parameters to use explicit Field
objects with default
values instead of Python default values, addressing a compatibility issue with the fastmcp library.
- Restructures function parameter definitions to use
Field(default=...)
instead of Python default parameters - Maintains the same functional behavior while fixing MCP tool argument handling
- Affects multiple MCP operation functions across connector registry, local operations, and cloud operations
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
airbyte/mcp/_local_ops.py | Refactors optional parameters in local connector operations functions |
airbyte/mcp/_connector_registry.py | Updates parameter definitions in connector listing function |
airbyte/mcp/_cloud_ops.py | Modifies cloud operations functions to use Field defaults |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📝 WalkthroughWalkthroughAdjusted Field(...) metadata defaults for parameters across MCP modules, moving default values into Field annotations without changing runtime logic. Updates span cloud operations, connector registry filtering parameters, and local ops functions, including explicit defaults for optional values and toggles. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. 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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 12
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
poetry.lock
is excluded by!**/*.lock
📒 Files selected for processing (3)
airbyte/mcp/_cloud_ops.py
(5 hunks)airbyte/mcp/_connector_registry.py
(1 hunks)airbyte/mcp/_local_ops.py
(6 hunks)
🧰 Additional context used
🪛 GitHub Actions: Run Linters
airbyte/mcp/_local_ops.py
[error] 390-390: Ruff: Line too long (E501) in airbyte/mcp/_local_ops.py:390.
⏰ 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). (4)
- GitHub Check: Pytest (All, Python 3.11, Ubuntu)
- GitHub Check: Pytest (All, Python 3.10, Windows)
- GitHub Check: Pytest (All, Python 3.11, Windows)
- GitHub Check: Pytest (All, Python 3.10, Ubuntu)
Workaround for issue logged here:
anyOf
in tool jsonSchema declarations break ability for clients to parse the JSON config jlowin/fastmcp#1871Note:
With this change, the input args are no longer optional from the perspective of Python itself. The caller would need to send some input for optional args if the functions were to be called from Python. However, since we aren't calling these directly, and they are only called via MCP, this should be fine for our purposes.
Summary by CodeRabbit
Documentation
Refactor
Important
Auto-merge enabled.
This PR is set to merge automatically when all requirements are met.