Interface BaseToolset

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
ApplicationIntegrationToolset, McpToolset

public interface BaseToolset extends AutoCloseable
Base interface for toolsets.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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 boolean
    isToolSelected(BaseTool tool, Optional<Object> toolFilter, Optional<ReadonlyContext> readonlyContext)
    Helper method to be used by implementers that returns true if the given tool is in the provided list of tools of if testing against the given ToolPredicate returns true (otherwise false).
  • Method Details

    • getTools

      io.reactivex.rxjava3.core.Flowable<BaseTool> getTools(ReadonlyContext readonlyContext)
      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

      void close() throws Exception
      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:
      close in interface AutoCloseable
      Throws:
      Exception
    • isToolSelected

      default boolean isToolSelected(BaseTool tool, Optional<Object> toolFilter, Optional<ReadonlyContext> readonlyContext)
      Helper method to be used by implementers that returns true if the given tool is in the provided list of tools of if testing against the given ToolPredicate returns true (otherwise false).
      Parameters:
      tool - The tool to check.
      toolFilter - An Optional containing either a ToolPredicate or a List of tool names.
      readonlyContext - The current context.
      Returns:
      true if the tool is selected.