|
18 | 18 |
|
19 | 19 | import java.time.Duration;
|
20 | 20 |
|
| 21 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 22 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 23 | + |
21 | 24 | import org.springframework.boot.context.properties.ConfigurationProperties;
|
22 | 25 |
|
23 | 26 | /**
|
24 | 27 | * Common Configuration properties for the Model Context Protocol (MCP) clients shared for
|
25 | 28 | * all transport types.
|
26 | 29 | *
|
27 | 30 | * @author Christian Tzolov
|
| 31 | + * @author Yangki Zhang |
28 | 32 | * @since 1.0.0
|
29 | 33 | */
|
30 | 34 | @ConfigurationProperties(McpClientCommonProperties.CONFIG_PREFIX)
|
@@ -101,6 +105,32 @@ public enum ClientType {
|
101 | 105 | */
|
102 | 106 | private boolean rootChangeNotification = true;
|
103 | 107 |
|
| 108 | + /** |
| 109 | + * Tool callback configuration. |
| 110 | + * <p> |
| 111 | + * This configuration is used to enable or disable tool callbacks in the MCP client. |
| 112 | + */ |
| 113 | + private Toolcallback toolcallback = new Toolcallback(false); |
| 114 | + |
| 115 | + /** |
| 116 | + * Represents a callback configuration for tools. |
| 117 | + * <p> |
| 118 | + * This record is used to encapsulate the configuration for enabling or disabling tool |
| 119 | + * callbacks in the MCP client. |
| 120 | + * |
| 121 | + * @param enabled A boolean flag indicating whether the tool callback is enabled. If |
| 122 | + * true, the tool callback is active; otherwise, it is disabled. |
| 123 | + */ |
| 124 | + @JsonInclude(JsonInclude.Include.NON_ABSENT) |
| 125 | + public record Toolcallback( |
| 126 | + |
| 127 | + /** |
| 128 | + * A boolean flag indicating whether the tool callback is enabled. If true, |
| 129 | + * the tool callback is active; otherwise, it is disabled. |
| 130 | + */ |
| 131 | + @JsonProperty("enabled") boolean enabled) { |
| 132 | + } |
| 133 | + |
104 | 134 | public boolean isEnabled() {
|
105 | 135 | return this.enabled;
|
106 | 136 | }
|
@@ -157,4 +187,12 @@ public void setRootChangeNotification(boolean rootChangeNotification) {
|
157 | 187 | this.rootChangeNotification = rootChangeNotification;
|
158 | 188 | }
|
159 | 189 |
|
| 190 | + public Toolcallback getToolcallback() { |
| 191 | + return toolcallback; |
| 192 | + } |
| 193 | + |
| 194 | + public void setToolcallback(Toolcallback toolcallback) { |
| 195 | + this.toolcallback = toolcallback; |
| 196 | + } |
| 197 | + |
160 | 198 | }
|
0 commit comments