fix: update http error code from invocation (#468)

Update http error code for invocation failure. Invocation may fail if
user fail to provide required parameter etc.

Fixes #465
This commit is contained in:
Yuan
2025-04-22 19:05:10 -07:00
committed by GitHub
parent 073ca58ac1
commit ff7c0ffc65

View File

@@ -220,7 +220,7 @@ func toolInvokeHandler(s *Server, w http.ResponseWriter, r *http.Request) {
if err != nil {
err = fmt.Errorf("error while invoking tool: %w", err)
s.logger.DebugContext(ctx, err.Error())
_ = render.Render(w, r, newErrResponse(err, http.StatusInternalServerError))
_ = render.Render(w, r, newErrResponse(err, http.StatusBadRequest))
return
}