File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -369,6 +369,7 @@ func handleLongRunningOperationTool(
369
369
"progress" : i ,
370
370
"total" : int (steps ),
371
371
"progressToken" : progressToken ,
372
+ "message" : fmt .Sprintf ("Server progress %v%%" , int (float64 (i )* 100 / steps )),
372
373
},
373
374
)
374
375
}
Original file line number Diff line number Diff line change @@ -371,6 +371,9 @@ type ProgressNotification struct {
371
371
Progress float64 `json:"progress"`
372
372
// Total number of items to process (or total progress required), if known.
373
373
Total float64 `json:"total,omitempty"`
374
+ // Message related to progress. This should provide relevant human-readable
375
+ // progress information.
376
+ Message string `json:"message,omitempty"`
374
377
} `json:"params"`
375
378
}
376
379
Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ func NewProgressNotification(
129
129
token ProgressToken ,
130
130
progress float64 ,
131
131
total * float64 ,
132
+ message * string ,
132
133
) ProgressNotification {
133
134
notification := ProgressNotification {
134
135
Notification : Notification {
@@ -138,6 +139,7 @@ func NewProgressNotification(
138
139
ProgressToken ProgressToken `json:"progressToken"`
139
140
Progress float64 `json:"progress"`
140
141
Total float64 `json:"total,omitempty"`
142
+ Message string `json:"message,omitempty"`
141
143
}{
142
144
ProgressToken : token ,
143
145
Progress : progress ,
@@ -146,6 +148,9 @@ func NewProgressNotification(
146
148
if total != nil {
147
149
notification .Params .Total = * total
148
150
}
151
+ if message != nil {
152
+ notification .Params .Message = * message
153
+ }
149
154
return notification
150
155
}
151
156
You can’t perform that action at this time.
0 commit comments