Class SpringAiMcpToolFactory
-
- All Implemented Interfaces:
-
com.embabel.agent.tools.mcp.McpToolFactory
public final class SpringAiMcpToolFactory implements McpToolFactory
-
-
Constructor Summary
Constructors Constructor Description SpringAiMcpToolFactory(List<McpSyncClient> clients)
-
Method Summary
Modifier and Type Method Description UnfoldingToolunfolding(String name, String description, Function1<ToolCallback, Boolean> filter, Boolean removeOnInvoke)Create an UnfoldingTool from MCP clients with a filter predicate. TooltoolByName(String toolName)Get a single MCP tool by exact name. ToolrequiredToolByName(String toolName)Get a single MCP tool by exact name, throwing if not found. -
Methods inherited from class com.embabel.agent.tools.mcp.McpToolFactory
matryoshka, matryoshka, matryoshkaByName, matryoshkaByName, matryoshkaMatching, matryoshkaMatching, unfolding, unfoldingByName, unfoldingByName, unfoldingMatching, unfoldingMatching -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
SpringAiMcpToolFactory
SpringAiMcpToolFactory(List<McpSyncClient> clients)
-
-
Method Detail
-
unfolding
UnfoldingTool unfolding(String name, String description, Function1<ToolCallback, Boolean> filter, Boolean removeOnInvoke)
Create an UnfoldingTool from MCP clients with a filter predicate.
- Parameters:
name- Name of the UnfoldingTool facadedescription- Description explaining when to use this tool categoryfilter- Predicate that returns true to include a toolremoveOnInvoke- Whether to remove the facade after invocation
-
toolByName
Tool toolByName(String toolName)
Get a single MCP tool by exact name.
- Parameters:
toolName- The exact name of the MCP tool- Returns:
The tool, or null if not found
-
requiredToolByName
Tool requiredToolByName(String toolName)
Get a single MCP tool by exact name, throwing if not found.
- Parameters:
toolName- The exact name of the MCP tool- Returns:
The tool
-
-
-
-