# Interface BaseToolset

All Superinterfaces:
  `AutoCloseable`

All Known Implementing Classes:
  `ApplicationIntegrationToolset, ComputerUseToolset, McpAsyncToolset, McpToolset`

public interface BaseToolset extends AutoCloseable
Base interface for toolsets.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  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, @Nullable Object toolFilter, @Nullable ReadonlyContext readonlyContext)`
  Checks if a tool should be selected based on a filter.

- ## 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, @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.