fix: failed to return err

This commit is contained in:
徐聪
2025-06-25 11:13:56 +08:00
parent 4f605d5558
commit 470bde97d7
10 changed files with 34 additions and 34 deletions

View File

@@ -47,7 +47,7 @@ func (t *ToolInput) Implement() server.ToolHandlerFunc {
// Input action logic
err = driverExt.Input(unifiedReq.Text)
if err != nil {
return NewMCPErrorResponse(fmt.Sprintf("Input failed: %s", err.Error())), nil
return NewMCPErrorResponse(fmt.Sprintf("Input failed: %s", err.Error())), err
}
message := fmt.Sprintf("Successfully input text: %s", unifiedReq.Text)
@@ -99,7 +99,7 @@ func (t *ToolSetIme) Implement() server.ToolHandlerFunc {
// Set IME action logic
err = driverExt.SetIme(unifiedReq.Ime)
if err != nil {
return NewMCPErrorResponse(fmt.Sprintf("Set IME failed: %s", err.Error())), nil
return NewMCPErrorResponse(fmt.Sprintf("Set IME failed: %s", err.Error())), err
}
message := fmt.Sprintf("Successfully set IME to: %s", unifiedReq.Ime)