Interface BaseToolset
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
ApplicationIntegrationToolset, ComputerUseToolset, McpAsyncToolset, McpToolset
Base interface for toolsets.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Performs cleanup and releases resources held by the toolset.io.reactivex.rxjava3.core.Flowable<BaseTool> getTools(ReadonlyContext readonlyContext) Return all tools in the toolset based on the provided context.default booleanisToolSelected(BaseTool tool, Object toolFilter, ReadonlyContext readonlyContext) Checks if a tool should be selected based on a filter.default booleanisToolSelected(BaseTool tool, Optional<Object> toolFilter, Optional<ReadonlyContext> readonlyContext) Deprecated.
-
Method Details
-
getTools
Return all tools in the toolset based on the provided context.- Parameters:
readonlyContext- Context used to filter tools available to the agent.- Returns:
- A Single emitting a list of tools available under the specified context.
-
close
Performs cleanup and releases resources held by the toolset.NOTE: This method is invoked, for example, at the end of an agent server's lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
isToolSelected
default boolean isToolSelected(BaseTool tool, @Nullable Object toolFilter, @Nullable ReadonlyContext readonlyContext) Checks if a tool should be selected based on a filter.- Parameters:
tool- The tool to check.toolFilter- A ToolPredicate, a List of tool names, or null.readonlyContext- The context for checking the tool, or null.
-
isToolSelected
@Deprecated default boolean isToolSelected(BaseTool tool, Optional<Object> toolFilter, Optional<ReadonlyContext> readonlyContext) Deprecated.UseisToolSelected(BaseTool, Object, ReadonlyContext)instead.
-
isToolSelected(BaseTool, Object, ReadonlyContext)instead.