Skip to content

Make Toolset.add chainable and flatten nested toolsets #9556

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

Closed
wants to merge 2 commits into from

Conversation

gulbaki
Copy link
Contributor

@gulbaki gulbaki commented Jun 26, 2025

Related Issues

Proposed Changes:

  • Modified add() to return self
  • This allows chaining calls like toolset.add(a).add(b)
  • Ensures nested Toolsets are flattened correctly

How did you test it?

  • Added test: test_toolset_add_can_flatten_nested_toolsets

Release notes

Added in releasenotes/notes/toolset-add-chainable.yaml

@gulbaki gulbaki requested review from a team as code owners June 26, 2025 14:36
@gulbaki gulbaki requested review from dfokina and sjrl and removed request for a team June 26, 2025 14:36
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 15904837847

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 90.294%

Files with Coverage Reduction New Missed Lines %
tools/toolset.py 1 92.98%
Totals Coverage Status
Change from base Build 15877046402: 0.02%
Covered Lines: 11712
Relevant Lines: 12971

💛 - Coveralls

@sjrl sjrl requested a review from vblagoje June 27, 2025 06:27
@sjrl
Copy link
Contributor

sjrl commented Jun 27, 2025

Hey @vblagoje since you have the most context on Toolset I think it'd be best if you review this

@sjrl sjrl removed their request for review June 27, 2025 06:28
@Amnah199 Amnah199 added this to the 2.15.1 milestone Jun 27, 2025
@vblagoje
Copy link
Member

@Amnah199 this one is not going into 2.15.1 - the bug is in mcp-haystack not core 🙏
Closing now, thanks for this contribution @gulbaki and apologies - I'll fix mcp-haystack where the bug originated

@vblagoje vblagoje closed this Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add multi server support to MCPTool and MCPToolset.
5 participants