@@ -228,11 +228,21 @@ func createIssue(client *github.Client, t translations.TranslationHelperFunc) (t
228
228
mcp .WithString ("body" ,
229
229
mcp .Description ("Issue body content" ),
230
230
),
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" ),
231
+ mcp .WithArray ("assignees" ,
232
+ mcp .Description ("Usernames to assign to this issue" ),
233
+ mcp .Items (
234
+ map [string ]interface {}{
235
+ "type" : "string" ,
236
+ },
237
+ ),
238
+ ),
239
+ mcp .WithArray ("labels" ,
240
+ mcp .Description ("Labels to apply to this issue" ),
241
+ mcp .Items (
242
+ map [string ]interface {}{
243
+ "type" : "string" ,
244
+ },
245
+ ),
236
246
),
237
247
),
238
248
func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
@@ -256,12 +266,13 @@ func createIssue(client *github.Client, t translations.TranslationHelperFunc) (t
256
266
}
257
267
258
268
// Get assignees
259
- assignees , err := optionalCommaSeparatedListParam (request , "assignees" )
269
+ assignees , err := optionalParam [[] string ] (request , "assignees" )
260
270
if err != nil {
261
271
return mcp .NewToolResultError (err .Error ()), nil
262
272
}
273
+
263
274
// Get labels
264
- labels , err := optionalCommaSeparatedListParam (request , "labels" )
275
+ labels , err := optionalParam [[] string ] (request , "labels" )
265
276
if err != nil {
266
277
return mcp .NewToolResultError (err .Error ()), nil
267
278
}
@@ -311,15 +322,23 @@ func listIssues(client *github.Client, t translations.TranslationHelperFunc) (to
311
322
),
312
323
mcp .WithString ("state" ,
313
324
mcp .Description ("Filter by state ('open', 'closed', 'all')" ),
325
+ mcp .Enum ("open" , "closed" , "all" ),
314
326
),
315
- mcp .WithString ("labels" ,
316
- mcp .Description ("Comma-separated list of labels to filter by" ),
327
+ mcp .WithArray ("labels" ,
328
+ mcp .Description ("Filter by labels" ),
329
+ mcp .Items (
330
+ map [string ]interface {}{
331
+ "type" : "string" ,
332
+ },
333
+ ),
317
334
),
318
335
mcp .WithString ("sort" ,
319
336
mcp .Description ("Sort by ('created', 'updated', 'comments')" ),
337
+ mcp .Enum ("created" , "updated" , "comments" ),
320
338
),
321
339
mcp .WithString ("direction" ,
322
340
mcp .Description ("Sort direction ('asc', 'desc')" ),
341
+ mcp .Enum ("asc" , "desc" ),
323
342
),
324
343
mcp .WithString ("since" ,
325
344
mcp .Description ("Filter by date (ISO 8601 timestamp)" ),
@@ -349,7 +368,8 @@ func listIssues(client *github.Client, t translations.TranslationHelperFunc) (to
349
368
return mcp .NewToolResultError (err .Error ()), nil
350
369
}
351
370
352
- opts .Labels , err = optionalCommaSeparatedListParam (request , "labels" )
371
+ // Get labels
372
+ opts .Labels , err = optionalParam [[]string ](request , "labels" )
353
373
if err != nil {
354
374
return mcp .NewToolResultError (err .Error ()), nil
355
375
}
@@ -431,12 +451,23 @@ func updateIssue(client *github.Client, t translations.TranslationHelperFunc) (t
431
451
),
432
452
mcp .WithString ("state" ,
433
453
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" ),
454
+ mcp .Enum ("open" , "closed" ),
455
+ ),
456
+ mcp .WithArray ("labels" ,
457
+ mcp .Description ("New labels" ),
458
+ mcp .Items (
459
+ map [string ]interface {}{
460
+ "type" : "string" ,
461
+ },
462
+ ),
463
+ ),
464
+ mcp .WithArray ("assignees" ,
465
+ mcp .Description ("New assignees" ),
466
+ mcp .Items (
467
+ map [string ]interface {}{
468
+ "type" : "string" ,
469
+ },
470
+ ),
440
471
),
441
472
mcp .WithNumber ("milestone" ,
442
473
mcp .Description ("New milestone number" ),
@@ -484,15 +515,17 @@ func updateIssue(client *github.Client, t translations.TranslationHelperFunc) (t
484
515
issueRequest .State = github .Ptr (state )
485
516
}
486
517
487
- labels , err := optionalCommaSeparatedListParam (request , "labels" )
518
+ // Get labels
519
+ labels , err := optionalParam [[]string ](request , "labels" )
488
520
if err != nil {
489
521
return mcp .NewToolResultError (err .Error ()), nil
490
522
}
491
523
if len (labels ) > 0 {
492
524
issueRequest .Labels = & labels
493
525
}
494
526
495
- assignees , err := optionalCommaSeparatedListParam (request , "assignees" )
527
+ // Get assignees
528
+ assignees , err := optionalParam [[]string ](request , "assignees" )
496
529
if err != nil {
497
530
return mcp .NewToolResultError (err .Error ()), nil
498
531
}
0 commit comments