@@ -144,15 +144,32 @@ func searchIssues(client *github.Client, t translations.TranslationHelperFunc) (
144
144
),
145
145
mcp .WithString ("sort" ,
146
146
mcp .Description ("Sort field (comments, reactions, created, etc.)" ),
147
+ mcp .Enum (
148
+ "comments" ,
149
+ "reactions" ,
150
+ "reactions-+1" ,
151
+ "reactions--1" ,
152
+ "reactions-smile" ,
153
+ "reactions-thinking_face" ,
154
+ "reactions-heart" ,
155
+ "reactions-tada" ,
156
+ "interactions" ,
157
+ "created" ,
158
+ "updated" ,
159
+ ),
147
160
),
148
161
mcp .WithString ("order" ,
149
162
mcp .Description ("Sort order ('asc' or 'desc')" ),
163
+ mcp .Enum ("asc" , "desc" ),
150
164
),
151
165
mcp .WithNumber ("per_page" ,
152
166
mcp .Description ("Results per page (max 100)" ),
167
+ mcp .Min (1 ),
168
+ mcp .Max (100 ),
153
169
),
154
170
mcp .WithNumber ("page" ,
155
171
mcp .Description ("Page number" ),
172
+ mcp .Min (1 ),
156
173
),
157
174
),
158
175
func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
@@ -228,11 +245,21 @@ func createIssue(client *github.Client, t translations.TranslationHelperFunc) (t
228
245
mcp .WithString ("body" ,
229
246
mcp .Description ("Issue body content" ),
230
247
),
231
- mcp .WithString ("assignees" ,
232
- mcp .Description ("Comma-separate list of usernames to assign to this issue" ),
233
- ),
234
- mcp .WithString ("labels" ,
235
- mcp .Description ("Comma-separate list of labels to apply to this issue" ),
248
+ mcp .WithArray ("assignees" ,
249
+ mcp .Description ("Usernames to assign to this issue" ),
250
+ mcp .Items (
251
+ map [string ]interface {}{
252
+ "type" : "string" ,
253
+ },
254
+ ),
255
+ ),
256
+ mcp .WithArray ("labels" ,
257
+ mcp .Description ("Labels to apply to this issue" ),
258
+ mcp .Items (
259
+ map [string ]interface {}{
260
+ "type" : "string" ,
261
+ },
262
+ ),
236
263
),
237
264
),
238
265
func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
@@ -256,12 +283,13 @@ func createIssue(client *github.Client, t translations.TranslationHelperFunc) (t
256
283
}
257
284
258
285
// Get assignees
259
- assignees , err := optionalCommaSeparatedListParam (request , "assignees" )
286
+ assignees , err := optionalParam [[] string ] (request , "assignees" )
260
287
if err != nil {
261
288
return mcp .NewToolResultError (err .Error ()), nil
262
289
}
290
+
263
291
// Get labels
264
- labels , err := optionalCommaSeparatedListParam (request , "labels" )
292
+ labels , err := optionalParam [[] string ] (request , "labels" )
265
293
if err != nil {
266
294
return mcp .NewToolResultError (err .Error ()), nil
267
295
}
@@ -311,15 +339,23 @@ func listIssues(client *github.Client, t translations.TranslationHelperFunc) (to
311
339
),
312
340
mcp .WithString ("state" ,
313
341
mcp .Description ("Filter by state ('open', 'closed', 'all')" ),
342
+ mcp .Enum ("open" , "closed" , "all" ),
314
343
),
315
- mcp .WithString ("labels" ,
316
- mcp .Description ("Comma-separated list of labels to filter by" ),
344
+ mcp .WithArray ("labels" ,
345
+ mcp .Description ("Filter by labels" ),
346
+ mcp .Items (
347
+ map [string ]interface {}{
348
+ "type" : "string" ,
349
+ },
350
+ ),
317
351
),
318
352
mcp .WithString ("sort" ,
319
353
mcp .Description ("Sort by ('created', 'updated', 'comments')" ),
354
+ mcp .Enum ("created" , "updated" , "comments" ),
320
355
),
321
356
mcp .WithString ("direction" ,
322
357
mcp .Description ("Sort direction ('asc', 'desc')" ),
358
+ mcp .Enum ("asc" , "desc" ),
323
359
),
324
360
mcp .WithString ("since" ,
325
361
mcp .Description ("Filter by date (ISO 8601 timestamp)" ),
@@ -349,7 +385,8 @@ func listIssues(client *github.Client, t translations.TranslationHelperFunc) (to
349
385
return mcp .NewToolResultError (err .Error ()), nil
350
386
}
351
387
352
- opts .Labels , err = optionalCommaSeparatedListParam (request , "labels" )
388
+ // Get labels
389
+ opts .Labels , err = optionalParam [[]string ](request , "labels" )
353
390
if err != nil {
354
391
return mcp .NewToolResultError (err .Error ()), nil
355
392
}
@@ -431,12 +468,23 @@ func updateIssue(client *github.Client, t translations.TranslationHelperFunc) (t
431
468
),
432
469
mcp .WithString ("state" ,
433
470
mcp .Description ("New state ('open' or 'closed')" ),
434
- ),
435
- mcp .WithString ("labels" ,
436
- mcp .Description ("Comma-separated list of new labels" ),
437
- ),
438
- mcp .WithString ("assignees" ,
439
- mcp .Description ("Comma-separated list of new assignees" ),
471
+ mcp .Enum ("open" , "closed" ),
472
+ ),
473
+ mcp .WithArray ("labels" ,
474
+ mcp .Description ("New labels" ),
475
+ mcp .Items (
476
+ map [string ]interface {}{
477
+ "type" : "string" ,
478
+ },
479
+ ),
480
+ ),
481
+ mcp .WithArray ("assignees" ,
482
+ mcp .Description ("New assignees" ),
483
+ mcp .Items (
484
+ map [string ]interface {}{
485
+ "type" : "string" ,
486
+ },
487
+ ),
440
488
),
441
489
mcp .WithNumber ("milestone" ,
442
490
mcp .Description ("New milestone number" ),
@@ -484,15 +532,17 @@ func updateIssue(client *github.Client, t translations.TranslationHelperFunc) (t
484
532
issueRequest .State = github .Ptr (state )
485
533
}
486
534
487
- labels , err := optionalCommaSeparatedListParam (request , "labels" )
535
+ // Get labels
536
+ labels , err := optionalParam [[]string ](request , "labels" )
488
537
if err != nil {
489
538
return mcp .NewToolResultError (err .Error ()), nil
490
539
}
491
540
if len (labels ) > 0 {
492
541
issueRequest .Labels = & labels
493
542
}
494
543
495
- assignees , err := optionalCommaSeparatedListParam (request , "assignees" )
544
+ // Get assignees
545
+ assignees , err := optionalParam [[]string ](request , "assignees" )
496
546
if err != nil {
497
547
return mcp .NewToolResultError (err .Error ()), nil
498
548
}
0 commit comments