Class HigressToolkit

java.lang.Object
io.agentscope.core.tool.Toolkit
io.agentscope.extensions.higress.HigressToolkit

public class HigressToolkit extends io.agentscope.core.tool.Toolkit
Toolkit extension for Higress AI Gateway integration.

This toolkit extends Toolkit to provide Higress-specific functionality while inheriting all standard toolkit features.

Example Usage


 // Create Higress MCP client
 HigressMcpClientWrapper client = HigressMcpClientBuilder
     .create("higress")
     .streamableHttpEndpoint("http://gateway/mcp-servers/union-tools-search")
     .build();

 // Register with toolkit
 HigressToolkit toolkit = new HigressToolkit();
 toolkit.registerMcpClient(client).block();

 // Or use fluent API for more options
 toolkit.registration()
     .mcpClient(client)
     .enableTools(List.of("tool1", "tool2"))
     .group("myGroup")
     .apply();
 
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class io.agentscope.core.tool.Toolkit

    io.agentscope.core.tool.Toolkit.ToolRegistration
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new HigressToolkit with default configuration.
    HigressToolkit(io.agentscope.core.tool.ToolkitConfig config)
    Creates a new HigressToolkit with custom configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the registered Higress MCP client.
    reactor.core.publisher.Mono<Void>
    registerMcpClient(io.agentscope.core.tool.mcp.McpClientWrapper mcpClientWrapper)
    Registers an MCP client with the toolkit.

    Methods inherited from class io.agentscope.core.tool.Toolkit

    addToolToGroup, callTool, callTools, callTools, callTools, closeMcpClients, copy, createSkillToolGroup, createToolGroup, createToolGroup, createToolGroup, findSkillToolGroupsByActivateOnSkill, getActiveGroups, getTool, getTool, getToolGroup, getToolNames, getToolSchemas, getToolSchemas, getToolSchemas, isExternalTool, isExternalTool, registerAgentTool, registerMetaTool, registerSchema, registerSchemas, registerTool, registerToolGroup, registration, removeMcpClient, removeTool, removeToolGroups, removeToolIfSame, setActiveGroups, setChunkCallback, updateToolGroups, updateToolPresetParameters

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HigressToolkit

      public HigressToolkit()
      Creates a new HigressToolkit with default configuration.
    • HigressToolkit

      public HigressToolkit(io.agentscope.core.tool.ToolkitConfig config)
      Creates a new HigressToolkit with custom configuration.
      Parameters:
      config - the toolkit configuration
  • Method Details

    • registerMcpClient

      public reactor.core.publisher.Mono<Void> registerMcpClient(io.agentscope.core.tool.mcp.McpClientWrapper mcpClientWrapper)
      Registers an MCP client with the toolkit.

      If the client is a HigressMcpClientWrapper, it will be cached for later access via getHigressMcpClient().

      For advanced registration options (filtering, groups), use the fluent API:

      
       toolkit.registration()
           .mcpClient(client)
           .enableTools(List.of("tool1"))
           .group("myGroup")
           .apply();
       
      Overrides:
      registerMcpClient in class io.agentscope.core.tool.Toolkit
      Parameters:
      mcpClientWrapper - the MCP client wrapper to register
      Returns:
      Mono that completes when registration is finished
    • getHigressMcpClient

      public HigressMcpClientWrapper getHigressMcpClient()
      Gets the registered Higress MCP client.
      Returns:
      the Higress MCP client, or null if not registered