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