Skip to content

Add inputs_from_state and outputs_to_state support to MCPToolset #2677

@sjrl

Description

@sjrl

Add support for inputs_from_state and outputs_to_state to MCPToolset. This is already supported for MCPTool, but is missing for MCPToolset.

As a follow up to @tstadel 's PR deepset-ai/haystack#10279 we should enable state-based configuration for MCPToolset. This would allow MCPTools to also take and add to State.

One thing to consider is that MCPToolset can contain multiple tools, so a single inputs_from_state and outputs_to_state configuration is not enough. Each tool in the toolset will need its own mapping.

One idea is to introduce per-tool state configuration, for example:

state_input_configs = {
    "tool_name_1": inputs_from_state_1,
    "tool_name_2": inputs_from_state_2,
}

A similar structure would be needed for outputs_to_state.

cc @vblagoje

P.S. This request originally came from Solution Engineers.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions