Interface ToolCustomization


public interface ToolCustomization

Customization applied to a single tool at tools/list and tools/call time. At least one of description or a non-empty parameters list must be present; a customization with neither has no effect and is rejected. Parameter names within parameters must be unique.


Example to create an instance using the builder pattern

     ToolCustomization toolCustomization = ToolCustomization.builder()
             .tool(McpServerTool.ALL)
             .build()
 
  • Method Details

    • getTool

      @NotNull @NotNull McpServerTool getTool()

      Name of the tool to customize, such as read_products or create_orders. Must be one of the tools enabled on the MCP Server.

      Returns:
      tool
    • getDescription

      String getDescription()

      Replacement description for the tool, shown to the AI agent.

      Returns:
      description
    • getParameters

      @Valid @Valid List<ParameterOverride> getParameters()

      Overrides applied to individual parameters of the tool's input schema.

      Returns:
      parameters
    • setTool

      void setTool(McpServerTool tool)

      Name of the tool to customize, such as read_products or create_orders. Must be one of the tools enabled on the MCP Server.

      Parameters:
      tool - value to be set
    • setDescription

      void setDescription(String description)

      Replacement description for the tool, shown to the AI agent.

      Parameters:
      description - value to be set
    • setParameters

      void setParameters(ParameterOverride... parameters)

      Overrides applied to individual parameters of the tool's input schema.

      Parameters:
      parameters - values to be set
    • setParameters

      void setParameters(List<ParameterOverride> parameters)

      Overrides applied to individual parameters of the tool's input schema.

      Parameters:
      parameters - values to be set
    • of

      static ToolCustomization of()
      factory method
      Returns:
      instance of ToolCustomization
    • of

      static ToolCustomization of(ToolCustomization template)
      factory method to create a shallow copy ToolCustomization
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      ToolCustomization copyDeep()
    • deepCopy

      @Nullable static ToolCustomization deepCopy(@Nullable ToolCustomization template)
      factory method to create a deep copy of ToolCustomization
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ToolCustomizationBuilder builder()
      builder factory method for ToolCustomization
      Returns:
      builder
    • builder

      static ToolCustomizationBuilder builder(ToolCustomization template)
      create builder for ToolCustomization instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withToolCustomization

      default <T> T withToolCustomization(Function<ToolCustomization,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static tools.jackson.core.type.TypeReference<ToolCustomization> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference