@@ -39,6 +39,11 @@ func (s *StreamTools) GetTools() []Tool {
39
39
"type" : "string" ,
40
40
"description" : "The name of the stream to get information about" ,
41
41
},
42
+ "flags" : map [string ]interface {}{
43
+ "type" : "array" ,
44
+ "items" : map [string ]interface {}{"type" : "string" },
45
+ "description" : "Optional flags to pass to the command" ,
46
+ },
42
47
},
43
48
Required : []string {"account_name" , "stream" },
44
49
},
@@ -56,6 +61,11 @@ func (s *StreamTools) GetTools() []Tool {
56
61
"type" : "string" ,
57
62
"description" : "The NATS account to use" ,
58
63
},
64
+ "flags" : map [string ]interface {}{
65
+ "type" : "array" ,
66
+ "items" : map [string ]interface {}{"type" : "string" },
67
+ "description" : "Optional flags to pass to the command" ,
68
+ },
59
69
},
60
70
Required : []string {"account_name" },
61
71
},
@@ -73,6 +83,11 @@ func (s *StreamTools) GetTools() []Tool {
73
83
"type" : "string" ,
74
84
"description" : "The NATS account to use" ,
75
85
},
86
+ "flags" : map [string ]interface {}{
87
+ "type" : "array" ,
88
+ "items" : map [string ]interface {}{"type" : "string" },
89
+ "description" : "Optional flags to pass to the command" ,
90
+ },
76
91
},
77
92
Required : []string {"account_name" },
78
93
},
@@ -90,6 +105,11 @@ func (s *StreamTools) GetTools() []Tool {
90
105
"type" : "string" ,
91
106
"description" : "The NATS account to use" ,
92
107
},
108
+ "flags" : map [string ]interface {}{
109
+ "type" : "array" ,
110
+ "items" : map [string ]interface {}{"type" : "string" },
111
+ "description" : "Optional flags to pass to the command" ,
112
+ },
93
113
},
94
114
Required : []string {"account_name" },
95
115
},
@@ -111,6 +131,11 @@ func (s *StreamTools) GetTools() []Tool {
111
131
"type" : "string" ,
112
132
"description" : "The name of the stream to get state for" ,
113
133
},
134
+ "flags" : map [string ]interface {}{
135
+ "type" : "array" ,
136
+ "items" : map [string ]interface {}{"type" : "string" },
137
+ "description" : "Optional flags to pass to the command" ,
138
+ },
114
139
},
115
140
Required : []string {"account_name" , "stream" },
116
141
},
@@ -132,6 +157,11 @@ func (s *StreamTools) GetTools() []Tool {
132
157
"type" : "string" ,
133
158
"description" : "Stream name" ,
134
159
},
160
+ "flags" : map [string ]interface {}{
161
+ "type" : "array" ,
162
+ "items" : map [string ]interface {}{"type" : "string" },
163
+ "description" : "Optional flags to pass to the command" ,
164
+ },
135
165
},
136
166
Required : []string {"account_name" , "stream" },
137
167
},
@@ -157,6 +187,11 @@ func (s *StreamTools) GetTools() []Tool {
157
187
"type" : "integer" ,
158
188
"description" : "Page size" ,
159
189
},
190
+ "flags" : map [string ]interface {}{
191
+ "type" : "array" ,
192
+ "items" : map [string ]interface {}{"type" : "string" },
193
+ "description" : "Optional flags to pass to the command" ,
194
+ },
160
195
},
161
196
Required : []string {"account_name" , "stream" , "size" },
162
197
},
@@ -182,6 +217,11 @@ func (s *StreamTools) GetTools() []Tool {
182
217
"type" : "string" ,
183
218
"description" : "Message Sequence to retrieve" ,
184
219
},
220
+ "flags" : map [string ]interface {}{
221
+ "type" : "array" ,
222
+ "items" : map [string ]interface {}{"type" : "string" },
223
+ "description" : "Optional flags to pass to the command" ,
224
+ },
185
225
},
186
226
Required : []string {"account_name" , "stream" , "id" },
187
227
},
@@ -191,6 +231,20 @@ func (s *StreamTools) GetTools() []Tool {
191
231
}
192
232
}
193
233
234
+ // Helper function to get flags from arguments
235
+ func getFlags (args map [string ]interface {}) []string {
236
+ if flags , ok := args ["flags" ].([]interface {}); ok {
237
+ strFlags := make ([]string , len (flags ))
238
+ for i , flag := range flags {
239
+ if strFlag , ok := flag .(string ); ok {
240
+ strFlags [i ] = strFlag
241
+ }
242
+ }
243
+ return strFlags
244
+ }
245
+ return nil
246
+ }
247
+
194
248
func (s * StreamTools ) streamInfoHandler () server.ToolHandlerFunc {
195
249
return func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
196
250
accountName , ok := request .Params .Arguments ["account_name" ].(string )
@@ -208,7 +262,12 @@ func (s *StreamTools) streamInfoHandler() server.ToolHandlerFunc {
208
262
return nil , err
209
263
}
210
264
211
- output , err := executor .ExecuteCommand ("stream" , "info" , stream )
265
+ args := []string {"stream" , "info" , stream }
266
+ if flags := getFlags (request .Params .Arguments ); flags != nil {
267
+ args = append (args , flags ... )
268
+ }
269
+
270
+ output , err := executor .ExecuteCommand (args ... )
212
271
if err != nil {
213
272
return nil , err
214
273
}
@@ -228,7 +287,12 @@ func (s *StreamTools) streamListHandler() server.ToolHandlerFunc {
228
287
return nil , err
229
288
}
230
289
231
- output , err := executor .ExecuteCommand ("stream" , "list" )
290
+ args := []string {"stream" , "list" }
291
+ if flags := getFlags (request .Params .Arguments ); flags != nil {
292
+ args = append (args , flags ... )
293
+ }
294
+
295
+ output , err := executor .ExecuteCommand (args ... )
232
296
if err != nil {
233
297
return nil , err
234
298
}
@@ -249,7 +313,12 @@ func (s *StreamTools) streamReportHandler() server.ToolHandlerFunc {
249
313
return nil , err
250
314
}
251
315
252
- output , err := executor .ExecuteCommand ("stream" , "report" )
316
+ args := []string {"stream" , "report" }
317
+ if flags := getFlags (request .Params .Arguments ); flags != nil {
318
+ args = append (args , flags ... )
319
+ }
320
+
321
+ output , err := executor .ExecuteCommand (args ... )
253
322
if err != nil {
254
323
return nil , err
255
324
}
@@ -270,7 +339,12 @@ func (s *StreamTools) streamFindHandler() server.ToolHandlerFunc {
270
339
return nil , err
271
340
}
272
341
273
- output , err := executor .ExecuteCommand ("stream" , "find" )
342
+ args := []string {"stream" , "find" }
343
+ if flags := getFlags (request .Params .Arguments ); flags != nil {
344
+ args = append (args , flags ... )
345
+ }
346
+
347
+ output , err := executor .ExecuteCommand (args ... )
274
348
if err != nil {
275
349
return nil , err
276
350
}
@@ -299,7 +373,12 @@ func (s *StreamTools) streamStateHandler() server.ToolHandlerFunc {
299
373
return nil , err
300
374
}
301
375
302
- output , err := executor .ExecuteCommand ("stream" , "state" , stream )
376
+ args := []string {"stream" , "state" , stream }
377
+ if flags := getFlags (request .Params .Arguments ); flags != nil {
378
+ args = append (args , flags ... )
379
+ }
380
+
381
+ output , err := executor .ExecuteCommand (args ... )
303
382
if err != nil {
304
383
return nil , err
305
384
}
@@ -328,7 +407,12 @@ func (s *StreamTools) streamSubjectsHandler() server.ToolHandlerFunc {
328
407
return nil , err
329
408
}
330
409
331
- output , err := executor .ExecuteCommand ("stream" , "subjects" , stream )
410
+ args := []string {"stream" , "subjects" , stream }
411
+ if flags := getFlags (request .Params .Arguments ); flags != nil {
412
+ args = append (args , flags ... )
413
+ }
414
+
415
+ output , err := executor .ExecuteCommand (args ... )
332
416
if err != nil {
333
417
return nil , err
334
418
}
@@ -363,7 +447,12 @@ func (s *StreamTools) streamViewHandler() server.ToolHandlerFunc {
363
447
return nil , err
364
448
}
365
449
366
- output , err := executor .ExecuteCommand ("stream" , "view" , stream , strconv .Itoa (size ))
450
+ args := []string {"stream" , "view" , stream , strconv .Itoa (size )}
451
+ if flags := getFlags (request .Params .Arguments ); flags != nil {
452
+ args = append (args , flags ... )
453
+ }
454
+
455
+ output , err := executor .ExecuteCommand (args ... )
367
456
if err != nil {
368
457
return nil , err
369
458
}
@@ -398,7 +487,12 @@ func (s *StreamTools) streamGetHandler() server.ToolHandlerFunc {
398
487
return nil , err
399
488
}
400
489
401
- output , err := executor .ExecuteCommand ("stream" , "get" , stream , id )
490
+ args := []string {"stream" , "get" , stream , id }
491
+ if flags := getFlags (request .Params .Arguments ); flags != nil {
492
+ args = append (args , flags ... )
493
+ }
494
+
495
+ output , err := executor .ExecuteCommand (args ... )
402
496
if err != nil {
403
497
return nil , err
404
498
}
0 commit comments