@@ -62,7 +62,7 @@ func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelp
6262 }
6363
6464 // Now execute the discussions query
65- var discussions []* github.Issue
65+ var discussions []* github.Discussion
6666 if categoryID != nil {
6767 // Query with category filter (server-side filtering)
6868 var query struct {
@@ -89,17 +89,15 @@ func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelp
8989 return mcp .NewToolResultError (err .Error ()), nil
9090 }
9191
92- // Map nodes to GitHub Issue objects
92+ // Map nodes to GitHub Discussion objects
9393 for _ , n := range query .Repository .Discussions .Nodes {
94- di := & github.Issue {
94+ di := & github.Discussion {
9595 Number : github .Ptr (int (n .Number )),
9696 Title : github .Ptr (string (n .Title )),
9797 HTMLURL : github .Ptr (string (n .URL )),
9898 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 )),
103101 },
104102 }
105103 discussions = append (discussions , di )
@@ -129,17 +127,15 @@ func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelp
129127 return mcp .NewToolResultError (err .Error ()), nil
130128 }
131129
132- // Map nodes to GitHub Issue objects
130+ // Map nodes to GitHub Discussion objects
133131 for _ , n := range query .Repository .Discussions .Nodes {
134- di := & github.Issue {
132+ di := & github.Discussion {
135133 Number : github .Ptr (int (n .Number )),
136134 Title : github .Ptr (string (n .Title )),
137135 HTMLURL : github .Ptr (string (n .URL )),
138136 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 )),
143139 },
144140 }
145141 discussions = append (discussions , di )
@@ -195,7 +191,6 @@ func GetDiscussion(getGQLClient GetGQLClientFn, t translations.TranslationHelper
195191 Discussion struct {
196192 Number githubv4.Int
197193 Body githubv4.String
198- State githubv4.String
199194 CreatedAt githubv4.DateTime
200195 URL githubv4.String `graphql:"url"`
201196 Category struct {
@@ -213,16 +208,13 @@ func GetDiscussion(getGQLClient GetGQLClientFn, t translations.TranslationHelper
213208 return mcp .NewToolResultError (err .Error ()), nil
214209 }
215210 d := q .Repository .Discussion
216- discussion := & github.Issue {
211+ discussion := & github.Discussion {
217212 Number : github .Ptr (int (d .Number )),
218213 Body : github .Ptr (string (d .Body )),
219- State : github .Ptr (string (d .State )),
220214 HTMLURL : github .Ptr (string (d .URL )),
221215 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 )),
226218 },
227219 }
228220 out , err := json .Marshal (discussion )
0 commit comments