feat: Add state-based configuration support to MCPToolset#2689
Merged
Conversation
sjrl
reviewed
Jan 12, 2026
sjrl
reviewed
Jan 12, 2026
sjrl
reviewed
Jan 12, 2026
sjrl
reviewed
Jan 12, 2026
sjrl
reviewed
Jan 12, 2026
sjrl
reviewed
Jan 12, 2026
Contributor
|
@vblagoje looking good! I wanted to ask if you could add an integration test using these configs to see if everything works as expected? |
…et.py Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>
…et.py Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>
…et.py Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>
mpangrazzi
reviewed
Jan 12, 2026
Contributor
mpangrazzi
left a comment
There was a problem hiding this comment.
Looks already good! I've added a few comments. +1 on adding an integration test as @sjrl mentioned.
Member
|
Nice work. Looks good from my end! |
Member
Author
|
This should be gtg now, please verify last three commits @sjrl
|
Member
Author
|
@tstadel it is ready for you - https://pypi.org/project/mcp-haystack/1.2.0/ |
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.
Why
Agents need tools that seamlessly share data through state.
MCPToolalready supportsinputs_from_stateandoutputs_to_statefor automatic parameter injection and output handling.MCPToolsetcouldn't use these features - breaking Agent workflows that rely on state propagation across multiple MCP tools.This PR completes MCP's Agent integration story.
MCPToolsetnow dynamically configures state mappings for each discovered tool, enabling the same seamless state-based coordination thatMCPToolprovides.inputs_from_stateandoutputs_to_statesupport toMCPToolset#2677What
Added per-tool state configuration to
MCPToolset:inputs_from_state,outputs_to_state,outputs_to_stringparameters (dict mapping tool names to configs)_serialize_state_config()/_deserialize_state_config()helpers handle both nested (outputs_to_state) and flat (outputs_to_string) formats_validate_state_configs()warns on unknown tool nameshaystack-ai>=2.19.0(supports state params)How can it be used
How did you test it
Notes for the reviewer
Parameter validation behavior: