@@ -319,9 +319,9 @@ func (s *Server) Start() error {
319319 if err := decoder .Decode (& request ); err != nil {
320320 if err == io .EOF {
321321 s .log ("Client disconnected (EOF)" )
322- } else {
323- s .log (fmt .Sprintf ("Error decoding request: %v" , err ))
322+ return nil
324323 }
324+ s .log (fmt .Sprintf ("Error decoding request: %v" , err ))
325325 fmt .Fprintf (os .Stderr , "Error decoding request: %v\n " , err )
326326 return fmt .Errorf ("error decoding request: %w" , err )
327327 }
@@ -568,9 +568,9 @@ func RunProxyServer(toolConfigs map[string]map[string]string) error {
568568 }
569569
570570 // Print registered tools
571- fmt .Println ( "Registered proxy tools:" )
571+ fmt .Fprintln ( os . Stderr , "Registered proxy tools:" )
572572 for name , tool := range server .tools {
573- fmt .Printf ( "- %s: %s (script: %s)\n " , name , tool .Description , tool .ScriptPath )
573+ fmt .Fprintf ( os . Stderr , "- %s: %s (script: %s)\n " , name , tool .Description , tool .ScriptPath )
574574 paramStr := ""
575575 for i , param := range tool .Parameters {
576576 if i > 0 {
@@ -579,7 +579,7 @@ func RunProxyServer(toolConfigs map[string]map[string]string) error {
579579 paramStr += param .Name + ":" + param .Type
580580 }
581581 if paramStr != "" {
582- fmt .Printf ( " Parameters: %s\n " , paramStr )
582+ fmt .Fprintf ( os . Stderr , " Parameters: %s\n " , paramStr )
583583 }
584584 }
585585
0 commit comments