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 @@ -130,6 +130,7 @@ func NewProgressNotification(
130
130
token ProgressToken ,
131
131
progress float64 ,
132
132
total * float64 ,
133
+ message * string ,
133
134
) ProgressNotification {
134
135
notification := ProgressNotification {
135
136
Notification : Notification {
@@ -139,6 +140,7 @@ func NewProgressNotification(
139
140
ProgressToken ProgressToken `json:"progressToken"`
140
141
Progress float64 `json:"progress"`
141
142
Total float64 `json:"total,omitempty"`
143
+ Message string `json:"message,omitempty"`
142
144
}{
143
145
ProgressToken : token ,
144
146
Progress : progress ,
@@ -147,6 +149,9 @@ func NewProgressNotification(
147
149
if total != nil {
148
150
notification .Params .Total = * total
149
151
}
152
+ if message != nil {
153
+ notification .Params .Message = * message
154
+ }
150
155
return notification
151
156
}
152
157
You can’t perform that action at this time.
0 commit comments