Class CommerceMcpServerConfigBuilder

java.lang.Object
com.commercetools.api.models.mcp_server.CommerceMcpServerConfigBuilder
All Implemented Interfaces:
Builder<CommerceMcpServerConfig>

public class CommerceMcpServerConfigBuilder extends Object implements Builder<CommerceMcpServerConfig>
CommerceMcpServerConfigBuilder
Example to create an instance using the builder pattern

     CommerceMcpServerConfig commerceMcpServerConfig = CommerceMcpServerConfig.builder()
             .majorVersion("{majorVersion}")
             .url("{url}")
             .plusTools(toolsBuilder -> toolsBuilder)
             .plusToolCustomizations(toolCustomizationsBuilder -> toolCustomizationsBuilder)
             .build()
 
  • Constructor Details

    • CommerceMcpServerConfigBuilder

      public CommerceMcpServerConfigBuilder()
  • Method Details

    • majorVersion

      public CommerceMcpServerConfigBuilder majorVersion(String majorVersion)

      Major version of this MCP Server type. Supported versions are v1 (deprecated) and v4.

      Parameters:
      majorVersion - value to be set
      Returns:
      Builder
    • url

      URL of the MCP Server. Generated by the system from the region, domain, Project key, and MCP Server key. Format: https://mcp.{region}.{domain}/projects/{projectKey}/{mcpServerKey}

      Parameters:
      url - value to be set
      Returns:
      Builder
    • tools

      List of tools enabled for this MCP Server. Use all to enable all available tools, or specify individual tool names such as read_products or create_orders. To reduce the number of LLM turns and improve overall performance, it is advisable to expose only the tools that are necessary, or at least minimize the exposure of tools that are unlikely to be used.

      Parameters:
      tools - value to be set
      Returns:
      Builder
    • tools

      List of tools enabled for this MCP Server. Use all to enable all available tools, or specify individual tool names such as read_products or create_orders. To reduce the number of LLM turns and improve overall performance, it is advisable to expose only the tools that are necessary, or at least minimize the exposure of tools that are unlikely to be used.

      Parameters:
      tools - value to be set
      Returns:
      Builder
    • plusTools

      public CommerceMcpServerConfigBuilder plusTools(McpServerTool... tools)

      List of tools enabled for this MCP Server. Use all to enable all available tools, or specify individual tool names such as read_products or create_orders. To reduce the number of LLM turns and improve overall performance, it is advisable to expose only the tools that are necessary, or at least minimize the exposure of tools that are unlikely to be used.

      Parameters:
      tools - value to be set
      Returns:
      Builder
    • toolCustomizations

      public CommerceMcpServerConfigBuilder toolCustomizations(ToolCustomization... toolCustomizations)

      Per-tool customizations applied at tools/list and tools/call time, such as overriding a tool's description or constraining its parameters.

      Parameters:
      toolCustomizations - value to be set
      Returns:
      Builder
    • toolCustomizations

      public CommerceMcpServerConfigBuilder toolCustomizations(List<ToolCustomization> toolCustomizations)

      Per-tool customizations applied at tools/list and tools/call time, such as overriding a tool's description or constraining its parameters.

      Parameters:
      toolCustomizations - value to be set
      Returns:
      Builder
    • plusToolCustomizations

      public CommerceMcpServerConfigBuilder plusToolCustomizations(ToolCustomization... toolCustomizations)

      Per-tool customizations applied at tools/list and tools/call time, such as overriding a tool's description or constraining its parameters.

      Parameters:
      toolCustomizations - value to be set
      Returns:
      Builder
    • plusToolCustomizations

      Per-tool customizations applied at tools/list and tools/call time, such as overriding a tool's description or constraining its parameters.

      Parameters:
      builder - function to build the toolCustomizations value
      Returns:
      Builder
    • withToolCustomizations

      Per-tool customizations applied at tools/list and tools/call time, such as overriding a tool's description or constraining its parameters.

      Parameters:
      builder - function to build the toolCustomizations value
      Returns:
      Builder
    • addToolCustomizations

      Per-tool customizations applied at tools/list and tools/call time, such as overriding a tool's description or constraining its parameters.

      Parameters:
      builder - function to build the toolCustomizations value
      Returns:
      Builder
    • setToolCustomizations

      Per-tool customizations applied at tools/list and tools/call time, such as overriding a tool's description or constraining its parameters.

      Parameters:
      builder - function to build the toolCustomizations value
      Returns:
      Builder
    • jsonOutputFiltering

      Response field-filtering rules applied to tool responses.

      Parameters:
      builder - function to build the jsonOutputFiltering value
      Returns:
      Builder
    • withJsonOutputFiltering

      Response field-filtering rules applied to tool responses.

      Parameters:
      builder - function to build the jsonOutputFiltering value
      Returns:
      Builder
    • jsonOutputFiltering

      public CommerceMcpServerConfigBuilder jsonOutputFiltering(@Nullable McpServerJsonOutputFiltering jsonOutputFiltering)

      Response field-filtering rules applied to tool responses.

      Parameters:
      jsonOutputFiltering - value to be set
      Returns:
      Builder
    • toolOutputFormatting

      public CommerceMcpServerConfigBuilder toolOutputFormatting(@Nullable McpServerToolOutputFormatting toolOutputFormatting)

      Output formatting applied to tool responses. When absent, responses are left untouched.

      Parameters:
      toolOutputFormatting - value to be set
      Returns:
      Builder
    • getMajorVersion

      public String getMajorVersion()

      Major version of this MCP Server type. Supported versions are v1 (deprecated) and v4.

      Returns:
      majorVersion
    • getUrl

      public String getUrl()

      URL of the MCP Server. Generated by the system from the region, domain, Project key, and MCP Server key. Format: https://mcp.{region}.{domain}/projects/{projectKey}/{mcpServerKey}

      Returns:
      url
    • getTools

      public List<McpServerTool> getTools()

      List of tools enabled for this MCP Server. Use all to enable all available tools, or specify individual tool names such as read_products or create_orders. To reduce the number of LLM turns and improve overall performance, it is advisable to expose only the tools that are necessary, or at least minimize the exposure of tools that are unlikely to be used.

      Returns:
      tools
    • getToolCustomizations

      public List<ToolCustomization> getToolCustomizations()

      Per-tool customizations applied at tools/list and tools/call time, such as overriding a tool's description or constraining its parameters.

      Returns:
      toolCustomizations
    • getJsonOutputFiltering

      @Nullable public McpServerJsonOutputFiltering getJsonOutputFiltering()

      Response field-filtering rules applied to tool responses.

      Returns:
      jsonOutputFiltering
    • getToolOutputFormatting

      @Nullable public McpServerToolOutputFormatting getToolOutputFormatting()

      Output formatting applied to tool responses. When absent, responses are left untouched.

      Returns:
      toolOutputFormatting
    • build

      public CommerceMcpServerConfig build()
      builds CommerceMcpServerConfig with checking for non-null required values
      Specified by:
      build in interface Builder<CommerceMcpServerConfig>
      Returns:
      CommerceMcpServerConfig
    • buildUnchecked

      public CommerceMcpServerConfig buildUnchecked()
      builds CommerceMcpServerConfig without checking for non-null required values
      Returns:
      CommerceMcpServerConfig
    • of

      public static CommerceMcpServerConfigBuilder of()
      factory method for an instance of CommerceMcpServerConfigBuilder
      Returns:
      builder
    • of

      create builder for CommerceMcpServerConfig instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder