Skip to content

Commit eaa682b

Browse files
committed
Add type to input schema
1 parent ea3025e commit eaa682b

File tree

13 files changed

+102
-29
lines changed

13 files changed

+102
-29
lines changed

pkg/github/actions.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func ListWorkflows(getClient GetClientFn, t translations.TranslationHelperFunc)
3232
ReadOnlyHint: true,
3333
},
3434
InputSchema: WithPagination(&jsonschema.Schema{
35+
Type: "object",
3536
Properties: map[string]*jsonschema.Schema{
3637
"owner": {
3738
Type: "string",
@@ -97,6 +98,7 @@ func ListWorkflowRuns(getClient GetClientFn, t translations.TranslationHelperFun
9798
ReadOnlyHint: true,
9899
},
99100
InputSchema: WithPagination(&jsonschema.Schema{
101+
Type: "object",
100102
Required: []string{"owner", "repo", "workflow_id"},
101103
Properties: map[string]*jsonschema.Schema{
102104
"owner": {
@@ -277,6 +279,7 @@ func RunWorkflow(getClient GetClientFn, t translations.TranslationHelperFunc) (t
277279
ReadOnlyHint: false,
278280
},
279281
InputSchema: &jsonschema.Schema{
282+
Type: "object",
280283
Required: []string{"owner", "repo", "workflow_id", "ref"},
281284
Properties: map[string]*jsonschema.Schema{
282285
"owner": {
@@ -406,6 +409,7 @@ func GetWorkflowRun(getClient GetClientFn, t translations.TranslationHelperFunc)
406409
ReadOnlyHint: true,
407410
},
408411
InputSchema: &jsonschema.Schema{
412+
Type: "object",
409413
Required: []string{"owner", "repo", "run_id"},
410414
Properties: map[string]*jsonschema.Schema{
411415
"owner": {
@@ -468,6 +472,7 @@ func GetWorkflowRunLogs(getClient GetClientFn, t translations.TranslationHelperF
468472
ReadOnlyHint: true,
469473
},
470474
InputSchema: &jsonschema.Schema{
475+
Type: "object",
471476
Required: []string{"owner", "repo", "run_id"},
472477
Properties: map[string]*jsonschema.Schema{
473478
"owner": {
@@ -564,6 +569,7 @@ func ListWorkflowJobs(getClient GetClientFn, t translations.TranslationHelperFun
564569
ReadOnlyHint: true,
565570
},
566571
InputSchema: WithPagination(&jsonschema.Schema{
572+
Type: "object",
567573
Required: []string{"owner", "repo", "run_id"},
568574
Properties: map[string]*jsonschema.Schema{
569575
"owner": {
@@ -661,6 +667,7 @@ func GetJobLogs(getClient GetClientFn, t translations.TranslationHelperFunc) (to
661667
ReadOnlyHint: true,
662668
},
663669
InputSchema: &jsonschema.Schema{
670+
Type: "object",
664671
Properties: map[string]*jsonschema.Schema{
665672
"owner": {
666673
Type: "string",
@@ -930,6 +937,7 @@ func RerunWorkflowRun(getClient GetClientFn, t translations.TranslationHelperFun
930937
ReadOnlyHint: false,
931938
},
932939
InputSchema: &jsonschema.Schema{
940+
Type: "object",
933941
Required: []string{"owner", "repo", "run_id"},
934942
Properties: map[string]*jsonschema.Schema{
935943
"owner": {
@@ -999,6 +1007,7 @@ func RerunFailedJobs(getClient GetClientFn, t translations.TranslationHelperFunc
9991007
ReadOnlyHint: false,
10001008
},
10011009
InputSchema: &jsonschema.Schema{
1010+
Type: "object",
10021011
Required: []string{"owner", "repo", "run_id"},
10031012
Properties: map[string]*jsonschema.Schema{
10041013
"owner": {
@@ -1068,6 +1077,7 @@ func CancelWorkflowRun(getClient GetClientFn, t translations.TranslationHelperFu
10681077
ReadOnlyHint: false,
10691078
},
10701079
InputSchema: &jsonschema.Schema{
1080+
Type: "object",
10711081
Required: []string{"owner", "repo", "run_id"},
10721082
Properties: map[string]*jsonschema.Schema{
10731083
"owner": {
@@ -1137,6 +1147,7 @@ func ListWorkflowRunArtifacts(getClient GetClientFn, t translations.TranslationH
11371147
ReadOnlyHint: true,
11381148
},
11391149
InputSchema: WithPagination(&jsonschema.Schema{
1150+
Type: "object",
11401151
Required: []string{"owner", "repo", "run_id"},
11411152
Properties: map[string]*jsonschema.Schema{
11421153
"owner": {
@@ -1211,6 +1222,7 @@ func DownloadWorkflowRunArtifact(getClient GetClientFn, t translations.Translati
12111222
ReadOnlyHint: true,
12121223
},
12131224
InputSchema: &jsonschema.Schema{
1225+
Type: "object",
12141226
Required: []string{"owner", "repo", "artifact_id"},
12151227
Properties: map[string]*jsonschema.Schema{
12161228
"owner": {
@@ -1283,6 +1295,7 @@ func DeleteWorkflowRunLogs(getClient GetClientFn, t translations.TranslationHelp
12831295
DestructiveHint: ToBoolPtr(true),
12841296
},
12851297
InputSchema: &jsonschema.Schema{
1298+
Type: "object",
12861299
Required: []string{"owner", "repo", "run_id"},
12871300
Properties: map[string]*jsonschema.Schema{
12881301
"owner": {
@@ -1352,6 +1365,7 @@ func GetWorkflowRunUsage(getClient GetClientFn, t translations.TranslationHelper
13521365
ReadOnlyHint: true,
13531366
},
13541367
InputSchema: &jsonschema.Schema{
1368+
Type: "object",
13551369
Required: []string{"owner", "repo", "run_id"},
13561370
Properties: map[string]*jsonschema.Schema{
13571371
"owner": {

pkg/github/code_scanning.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func GetCodeScanningAlert(getClient GetClientFn, t translations.TranslationHelpe
2424
ReadOnlyHint: true,
2525
},
2626
InputSchema: &jsonschema.Schema{
27+
Type: "object",
2728
Required: []string{"owner", "repo", "alertNumber"},
2829
Properties: map[string]*jsonschema.Schema{
2930
"owner": {
@@ -96,6 +97,7 @@ func ListCodeScanningAlerts(getClient GetClientFn, t translations.TranslationHel
9697
ReadOnlyHint: true,
9798
},
9899
InputSchema: &jsonschema.Schema{
100+
Type: "object",
99101
Required: []string{"owner", "repo"},
100102
Properties: map[string]*jsonschema.Schema{
101103
"owner": {

pkg/github/dependabot.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func GetDependabotAlert(getClient GetClientFn, t translations.TranslationHelperF
2424
ReadOnlyHint: true,
2525
},
2626
InputSchema: &jsonschema.Schema{
27+
Type: "object",
2728
Required: []string{"owner", "repo", "alertNumber"},
2829
Properties: map[string]*jsonschema.Schema{
2930
"owner": {
@@ -96,6 +97,7 @@ func ListDependabotAlerts(getClient GetClientFn, t translations.TranslationHelpe
9697
ReadOnlyHint: true,
9798
},
9899
InputSchema: &jsonschema.Schema{
100+
Type: "object",
99101
Required: []string{"owner", "repo"},
100102
Properties: map[string]*jsonschema.Schema{
101103
"owner": {

pkg/github/discussions.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelp
2323
ReadOnlyHint: true,
2424
},
2525
InputSchema: &jsonschema.Schema{
26+
Type: "object",
2627
Required: []string{"owner", "repo"},
2728
Properties: map[string]*jsonschema.Schema{
2829
"owner": {
@@ -168,6 +169,7 @@ func GetDiscussion(getGQLClient GetGQLClientFn, t translations.TranslationHelper
168169
ReadOnlyHint: true,
169170
},
170171
InputSchema: &jsonschema.Schema{
172+
Type: "object",
171173
Required: []string{"owner", "repo", "discussionNumber"},
172174
Properties: map[string]*jsonschema.Schema{
173175
"owner": {
@@ -249,6 +251,7 @@ func GetDiscussionComments(getGQLClient GetGQLClientFn, t translations.Translati
249251
ReadOnlyHint: true,
250252
},
251253
InputSchema: &jsonschema.Schema{
254+
Type: "object",
252255
Required: []string{"owner", "repo", "discussionNumber"},
253256
Properties: map[string]*jsonschema.Schema{
254257
"owner": {
@@ -324,6 +327,7 @@ func ListDiscussionCategories(getGQLClient GetGQLClientFn, t translations.Transl
324327
ReadOnlyHint: true,
325328
},
326329
InputSchema: &jsonschema.Schema{
330+
Type: "object",
327331
Required: []string{"owner", "repo"},
328332
Properties: map[string]*jsonschema.Schema{
329333
"owner": {

pkg/github/dynamic_tools.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func EnableToolset(s *mcp.Server, toolsetGroup *toolsets.ToolsetGroup, t transla
3030
ReadOnlyHint: true,
3131
},
3232
InputSchema: &jsonschema.Schema{
33+
Type: "object",
3334
Required: []string{"toolset"},
3435
Properties: map[string]*jsonschema.Schema{
3536
"toolset": {
@@ -69,6 +70,7 @@ func ListAvailableToolsets(toolsetGroup *toolsets.ToolsetGroup, t translations.T
6970
ReadOnlyHint: true,
7071
},
7172
InputSchema: &jsonschema.Schema{
73+
Type: "object",
7274
Properties: map[string]*jsonschema.Schema{},
7375
},
7476
},
@@ -107,6 +109,7 @@ func GetToolsetsTools(toolsetGroup *toolsets.ToolsetGroup, t translations.Transl
107109
ReadOnlyHint: true,
108110
},
109111
InputSchema: &jsonschema.Schema{
112+
Type: "object",
110113
Required: []string{"toolset"},
111114
Properties: map[string]*jsonschema.Schema{
112115
"toolset": {

pkg/github/issues.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func GetIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool
2828
ReadOnlyHint: true,
2929
},
3030
InputSchema: &jsonschema.Schema{
31+
Type: "object",
3132
Required: []string{"owner", "repo", "issue_number"},
3233
Properties: map[string]*jsonschema.Schema{
3334
"owner": {
@@ -96,6 +97,7 @@ func AddIssueComment(getClient GetClientFn, t translations.TranslationHelperFunc
9697
ReadOnlyHint: false,
9798
},
9899
InputSchema: &jsonschema.Schema{
100+
Type: "object",
99101
Required: []string{"owner", "repo", "issue_number", "body"},
100102
Properties: map[string]*jsonschema.Schema{
101103
"owner": {
@@ -176,6 +178,7 @@ func SearchIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (
176178
ReadOnlyHint: true,
177179
},
178180
InputSchema: WithPagination(&jsonschema.Schema{
181+
Type: "object",
179182
Required: []string{"query"},
180183
Properties: map[string]*jsonschema.Schema{
181184
"query": {
@@ -230,6 +233,7 @@ func CreateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (t
230233
ReadOnlyHint: false,
231234
},
232235
InputSchema: &jsonschema.Schema{
236+
Type: "object",
233237
Required: []string{"owner", "repo", "title"},
234238
Properties: map[string]*jsonschema.Schema{
235239
"owner": {
@@ -358,6 +362,7 @@ func ListIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (to
358362
ReadOnlyHint: true,
359363
},
360364
InputSchema: WithPagination(&jsonschema.Schema{
365+
Type: "object",
361366
Required: []string{"owner", "repo"},
362367
Properties: map[string]*jsonschema.Schema{
363368
"owner": {
@@ -487,6 +492,7 @@ func UpdateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (t
487492
ReadOnlyHint: false,
488493
},
489494
InputSchema: &jsonschema.Schema{
495+
Type: "object",
490496
Required: []string{"owner", "repo", "issue_number"},
491497
Properties: map[string]*jsonschema.Schema{
492498
"owner": {
@@ -641,6 +647,7 @@ func GetIssueComments(getClient GetClientFn, t translations.TranslationHelperFun
641647
ReadOnlyHint: true,
642648
},
643649
InputSchema: WithPagination(&jsonschema.Schema{
650+
Type: "object",
644651
Required: []string{"owner", "repo", "issue_number"},
645652
Properties: map[string]*jsonschema.Schema{
646653
"owner": {
@@ -760,6 +767,7 @@ func AssignCopilotToIssue(getGQLClient GetGQLClientFn, t translations.Translatio
760767
IdempotentHint: true,
761768
},
762769
InputSchema: &jsonschema.Schema{
770+
Type: "object",
763771
Required: []string{"owner", "repo", "issueNumber"},
764772
Properties: map[string]*jsonschema.Schema{
765773
"owner": {

pkg/github/notifications.go

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,41 +25,39 @@ const (
2525

2626
// ListNotifications creates a tool to list notifications for the current user.
2727
func ListNotifications(getClient GetClientFn, t translations.TranslationHelperFunc) (tool *mcp.Tool, handler mcp.ToolHandler) {
28-
schema := &jsonschema.Schema{
29-
Properties: map[string]*jsonschema.Schema{
30-
"filter": {
31-
Type: "string",
32-
Description: "Filter notifications to, use default unless specified. Read notifications are ones that have already been acknowledged by the user. Participating notifications are those that the user is directly involved in, such as issues or pull requests they have commented on or created.",
33-
Enum: []any{FilterDefault, FilterIncludeRead, FilterOnlyParticipating},
34-
},
35-
"since": {
36-
Type: "string",
37-
Description: "Only show notifications updated after the given time (ISO 8601 format)",
38-
},
39-
"before": {
40-
Type: "string",
41-
Description: "Only show notifications updated before the given time (ISO 8601 format)",
42-
},
43-
"owner": {
44-
Type: "string",
45-
Description: "Optional repository owner. If provided with repo, only notifications for this repository are listed.",
46-
},
47-
"repo": {
48-
Type: "string",
49-
Description: "Optional repository name. If provided with owner, only notifications for this repository are listed.",
50-
},
51-
},
52-
}
53-
WithPagination(schema)
54-
5528
return &mcp.Tool{
5629
Name: "list_notifications",
5730
Description: t("TOOL_LIST_NOTIFICATIONS_DESCRIPTION", "Lists all GitHub notifications for the authenticated user, including unread notifications, mentions, review requests, assignments, and updates on issues or pull requests. Use this tool whenever the user asks what to work on next, requests a summary of their GitHub activity, wants to see pending reviews, or needs to check for new updates or tasks. This tool is the primary way to discover actionable items, reminders, and outstanding work on GitHub. Always call this tool when asked what to work on next, what is pending, or what needs attention in GitHub."),
5831
Annotations: &mcp.ToolAnnotations{
5932
Title: t("TOOL_LIST_NOTIFICATIONS_USER_TITLE", "List notifications"),
6033
ReadOnlyHint: true,
6134
},
62-
InputSchema: schema,
35+
InputSchema: WithPagination(&jsonschema.Schema{
36+
Type: "object",
37+
Properties: map[string]*jsonschema.Schema{
38+
"filter": {
39+
Type: "string",
40+
Description: "Filter notifications to, use default unless specified. Read notifications are ones that have already been acknowledged by the user. Participating notifications are those that the user is directly involved in, such as issues or pull requests they have commented on or created.",
41+
Enum: []any{FilterDefault, FilterIncludeRead, FilterOnlyParticipating},
42+
},
43+
"since": {
44+
Type: "string",
45+
Description: "Only show notifications updated after the given time (ISO 8601 format)",
46+
},
47+
"before": {
48+
Type: "string",
49+
Description: "Only show notifications updated before the given time (ISO 8601 format)",
50+
},
51+
"owner": {
52+
Type: "string",
53+
Description: "Optional repository owner. If provided with repo, only notifications for this repository are listed.",
54+
},
55+
"repo": {
56+
Type: "string",
57+
Description: "Optional repository name. If provided with owner, only notifications for this repository are listed.",
58+
},
59+
},
60+
}),
6361
},
6462
func(ctx context.Context, session *mcp.ServerSession, request *mcp.CallToolParamsFor[map[string]any]) (*mcp.CallToolResult, error) {
6563
client, err := getClient(ctx)
@@ -168,6 +166,7 @@ func DismissNotification(getclient GetClientFn, t translations.TranslationHelper
168166
ReadOnlyHint: false,
169167
},
170168
InputSchema: &jsonschema.Schema{
169+
Type: "object",
171170
Required: []string{"threadID"},
172171
Properties: map[string]*jsonschema.Schema{
173172
"threadID": {
@@ -245,6 +244,7 @@ func MarkAllNotificationsRead(getClient GetClientFn, t translations.TranslationH
245244
ReadOnlyHint: false,
246245
},
247246
InputSchema: &jsonschema.Schema{
247+
Type: "object",
248248
Properties: map[string]*jsonschema.Schema{
249249
"lastReadAt": {
250250
Type: "string",
@@ -332,6 +332,7 @@ func GetNotificationDetails(getClient GetClientFn, t translations.TranslationHel
332332
ReadOnlyHint: true,
333333
},
334334
InputSchema: &jsonschema.Schema{
335+
Type: "object",
335336
Required: []string{"notificationID"},
336337
Properties: map[string]*jsonschema.Schema{
337338
"notificationID": {
@@ -396,6 +397,7 @@ func ManageNotificationSubscription(getClient GetClientFn, t translations.Transl
396397
ReadOnlyHint: false,
397398
},
398399
InputSchema: &jsonschema.Schema{
400+
Type: "object",
399401
Required: []string{"notificationID", "action"},
400402
Properties: map[string]*jsonschema.Schema{
401403
"notificationID": {
@@ -487,6 +489,7 @@ func ManageRepositoryNotificationSubscription(getClient GetClientFn, t translati
487489
ReadOnlyHint: false,
488490
},
489491
InputSchema: &jsonschema.Schema{
492+
Type: "object",
490493
Required: []string{"owner", "repo", "action"},
491494
Properties: map[string]*jsonschema.Schema{
492495
"owner": {

0 commit comments

Comments
 (0)