@@ -62,7 +62,7 @@ func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelp
62
62
}
63
63
64
64
// Now execute the discussions query
65
- var discussions []* github.Issue
65
+ var discussions []* github.Discussion
66
66
if categoryID != nil {
67
67
// Query with category filter (server-side filtering)
68
68
var query struct {
@@ -89,17 +89,15 @@ func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelp
89
89
return mcp .NewToolResultError (err .Error ()), nil
90
90
}
91
91
92
- // Map nodes to GitHub Issue objects
92
+ // Map nodes to GitHub Discussion objects
93
93
for _ , n := range query .Repository .Discussions .Nodes {
94
- di := & github.Issue {
94
+ di := & github.Discussion {
95
95
Number : github .Ptr (int (n .Number )),
96
96
Title : github .Ptr (string (n .Title )),
97
97
HTMLURL : github .Ptr (string (n .URL )),
98
98
CreatedAt : & github.Timestamp {Time : n .CreatedAt .Time },
99
- Labels : []* github.Label {
100
- {
101
- Name : github .Ptr (fmt .Sprintf ("category:%s" , string (n .Category .Name ))),
102
- },
99
+ DiscussionCategory : & github.DiscussionCategory {
100
+ Name : github .Ptr (string (n .Category .Name )),
103
101
},
104
102
}
105
103
discussions = append (discussions , di )
@@ -129,17 +127,15 @@ func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelp
129
127
return mcp .NewToolResultError (err .Error ()), nil
130
128
}
131
129
132
- // Map nodes to GitHub Issue objects
130
+ // Map nodes to GitHub Discussion objects
133
131
for _ , n := range query .Repository .Discussions .Nodes {
134
- di := & github.Issue {
132
+ di := & github.Discussion {
135
133
Number : github .Ptr (int (n .Number )),
136
134
Title : github .Ptr (string (n .Title )),
137
135
HTMLURL : github .Ptr (string (n .URL )),
138
136
CreatedAt : & github.Timestamp {Time : n .CreatedAt .Time },
139
- Labels : []* github.Label {
140
- {
141
- Name : github .Ptr (fmt .Sprintf ("category:%s" , string (n .Category .Name ))),
142
- },
137
+ DiscussionCategory : & github.DiscussionCategory {
138
+ Name : github .Ptr (string (n .Category .Name )),
143
139
},
144
140
}
145
141
discussions = append (discussions , di )
@@ -195,7 +191,6 @@ func GetDiscussion(getGQLClient GetGQLClientFn, t translations.TranslationHelper
195
191
Discussion struct {
196
192
Number githubv4.Int
197
193
Body githubv4.String
198
- State githubv4.String
199
194
CreatedAt githubv4.DateTime
200
195
URL githubv4.String `graphql:"url"`
201
196
Category struct {
@@ -213,16 +208,13 @@ func GetDiscussion(getGQLClient GetGQLClientFn, t translations.TranslationHelper
213
208
return mcp .NewToolResultError (err .Error ()), nil
214
209
}
215
210
d := q .Repository .Discussion
216
- discussion := & github.Issue {
211
+ discussion := & github.Discussion {
217
212
Number : github .Ptr (int (d .Number )),
218
213
Body : github .Ptr (string (d .Body )),
219
- State : github .Ptr (string (d .State )),
220
214
HTMLURL : github .Ptr (string (d .URL )),
221
215
CreatedAt : & github.Timestamp {Time : d .CreatedAt .Time },
222
- Labels : []* github.Label {
223
- {
224
- Name : github .Ptr (fmt .Sprintf ("category:%s" , string (d .Category .Name ))),
225
- },
216
+ DiscussionCategory : & github.DiscussionCategory {
217
+ Name : github .Ptr (string (d .Category .Name )),
226
218
},
227
219
}
228
220
out , err := json .Marshal (discussion )
0 commit comments