File tree Expand file tree Collapse file tree 4 files changed +13
-11
lines changed
labs/arthas-mcp-server/src/main/java/com/taobao/arthas/mcp/server Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -100,27 +100,27 @@ private McpSchema() {
100100 public static final class ErrorCodes {
101101
102102 /**
103- * 服务器收到的 JSON 无效。
103+ * The JSON received by the server is invalid.
104104 */
105105 public static final int PARSE_ERROR = -32700 ;
106106
107107 /**
108- * 发送的 JSON 不是有效的 Request 对象。
108+ * The JSON sent is not a valid Request object.
109109 */
110110 public static final int INVALID_REQUEST = -32600 ;
111111
112112 /**
113- * 该方法不存在/不可用。
113+ * The method does not exist or is unavailable.
114114 */
115115 public static final int METHOD_NOT_FOUND = -32601 ;
116116
117117 /**
118- * 方法参数无效。
118+ * Invalid method parameters.
119119 */
120120 public static final int INVALID_PARAMS = -32602 ;
121121
122122 /**
123- * 内部 JSON-RPC 错误。
123+ * Internal JSON-RPC error.
124124 */
125125 public static final int INTERNAL_ERROR = -32603 ;
126126
Original file line number Diff line number Diff line change @@ -83,9 +83,10 @@ public String getId() {
8383 }
8484
8585 /**
86- * 在客户端和服务器之间成功初始化序列后调用,包含客户端能力和信息。
87- * @param clientCapabilities 连接的客户端提供的能力
88- * @param clientInfo 关于连接的客户端的信息
86+ * Called after successfully initializing the sequence between the client and server,
87+ * including client capabilities and information.
88+ * @param clientCapabilities The capabilities provided by the connected client
89+ * @param clientInfo Information about the connected client
8990 */
9091 public void init (McpSchema .ClientCapabilities clientCapabilities , McpSchema .Implementation clientInfo ) {
9192 this .clientCapabilities .lazySet (clientCapabilities );
@@ -331,7 +332,9 @@ private CompletableFuture<McpSchema.JSONRPCResponse> handleIncomingRequest(McpSc
331332 /**
332333 * Handle incoming JSON-RPC notifications, routing them to the appropriate handler.
333334 * @param notification incoming JSON-RPC notification
334- * @return indicates the CompletableFuture in which the notification processing is complete
335+ * @return a CompletableFuture that completes when the notification processing is finished.
336+ * The CompletableFuture completes normally if the processing succeeds, or exceptionally
337+ * if an error occurs during processing.
335338 */
336339 private CompletableFuture <Void > handleIncomingNotification (McpSchema .JSONRPCNotification notification ) {
337340 String method = notification .getMethod ();
Original file line number Diff line number Diff line change 1818import java .util .Map ;
1919import java .util .stream .Stream ;
2020
21- public class DefaultToolCallback implements ToolCallback {
21+ public class DefaultToolCallback implements ToolCallback {
2222
2323 private static final Logger logger = LoggerFactory .getLogger (DefaultToolCallback .class );
2424
Original file line number Diff line number Diff line change @@ -136,7 +136,6 @@ private static boolean isParameterRequired(Parameter parameter) {
136136 }
137137
138138 private static String getParameterDescription (Parameter parameter ) {
139- // 检查ToolParam注解
140139 ToolParam toolParam = parameter .getAnnotation (ToolParam .class );
141140 if (toolParam != null && toolParam .description () != null && !toolParam .description ().isEmpty ()) {
142141 return toolParam .description ();
You can’t perform that action at this time.
0 commit comments