@@ -51,6 +51,22 @@ type MinimalSearchRepositoriesResult struct {
5151 Items []MinimalRepository `json:"items"`
5252}
5353
54+ // MinimalCodeSearchResult is the trimmed output type for code search results.
55+ type MinimalCodeSearchResult struct {
56+ TotalCount int `json:"total_count"`
57+ IncompleteResults bool `json:"incomplete_results"`
58+ Items []MinimalCodeSearchItem `json:"items"`
59+ }
60+
61+ // MinimalCodeSearchItem is the trimmed output type for code search result objects.
62+ type MinimalCodeSearchItem struct {
63+ Name string `json:"name,omitempty"`
64+ Path string `json:"path,omitempty"`
65+ SHA string `json:"sha,omitempty"`
66+ HTMLURL string `json:"html_url,omitempty"`
67+ Repository * MinimalRepository `json:"repository,omitempty"`
68+ }
69+
5470// MinimalCommitAuthor represents commit author information.
5571type MinimalCommitAuthor struct {
5672 Name string `json:"name,omitempty"`
@@ -104,6 +120,11 @@ type MinimalCommit struct {
104120 Files []MinimalCommitFile `json:"files,omitempty"`
105121}
106122
123+ // MinimalCommitsResponse wraps commits for MCP structured output.
124+ type MinimalCommitsResponse struct {
125+ Commits []MinimalCommit `json:"commits"`
126+ }
127+
107128// MinimalRelease is the trimmed output type for release objects.
108129type MinimalRelease struct {
109130 ID int64 `json:"id"`
@@ -117,19 +138,58 @@ type MinimalRelease struct {
117138 Author * MinimalUser `json:"author,omitempty"`
118139}
119140
141+ // MinimalReleasesResponse wraps releases for MCP structured output.
142+ type MinimalReleasesResponse struct {
143+ Releases []MinimalRelease `json:"releases"`
144+ }
145+
120146// MinimalBranch is the trimmed output type for branch objects.
121147type MinimalBranch struct {
122148 Name string `json:"name"`
123149 SHA string `json:"sha"`
124150 Protected bool `json:"protected"`
125151}
126152
153+ // MinimalBranchesResponse wraps branches for MCP structured output.
154+ type MinimalBranchesResponse struct {
155+ Branches []MinimalBranch `json:"branches"`
156+ }
157+
127158// MinimalTag is the trimmed output type for tag objects.
128159type MinimalTag struct {
129160 Name string `json:"name"`
130161 SHA string `json:"sha"`
131162}
132163
164+ // MinimalTagsResponse wraps tags for MCP structured output.
165+ type MinimalTagsResponse struct {
166+ Tags []MinimalTag `json:"tags"`
167+ }
168+
169+ // MinimalIssueType is the trimmed output type for issue type objects.
170+ type MinimalIssueType struct {
171+ ID int64 `json:"id,omitempty"`
172+ NodeID string `json:"node_id,omitempty"`
173+ Name string `json:"name,omitempty"`
174+ Description string `json:"description,omitempty"`
175+ Color string `json:"color,omitempty"`
176+ CreatedAt string `json:"created_at,omitempty"`
177+ UpdatedAt string `json:"updated_at,omitempty"`
178+ }
179+
180+ // MinimalIssueTypesResponse wraps issue types for MCP structured output.
181+ type MinimalIssueTypesResponse struct {
182+ IssueTypes []MinimalIssueType `json:"issue_types"`
183+ }
184+
185+ // MinimalLabel is the output type for repository labels.
186+ type MinimalLabel struct {
187+ ID string `json:"id"`
188+ Name string `json:"name"`
189+ Color string `json:"color,omitempty"`
190+ Description string `json:"description,omitempty"`
191+ }
192+
133193// MinimalResponse represents a minimal response for all CRUD operations.
134194// Success is implicit in the HTTP response status, and all other information
135195// can be derived from the URL or fetched separately if needed.
@@ -200,6 +260,13 @@ type MinimalIssuesResponse struct {
200260 PageInfo MinimalPageInfo `json:"pageInfo"`
201261}
202262
263+ // MinimalSearchIssuesResult is the trimmed output type for issue and pull request search results.
264+ type MinimalSearchIssuesResult struct {
265+ TotalCount int `json:"total_count"`
266+ IncompleteResults bool `json:"incomplete_results"`
267+ Items []MinimalIssue `json:"items"`
268+ }
269+
203270// MinimalIssueComment is the trimmed output type for issue comment objects to reduce verbosity.
204271type MinimalIssueComment struct {
205272 ID int64 `json:"id"`
@@ -622,6 +689,36 @@ func convertToMinimalUser(user *github.User) *MinimalUser {
622689 }
623690}
624691
692+ func convertToMinimalRepository (repo * github.Repository ) MinimalRepository {
693+ minimalRepo := MinimalRepository {
694+ ID : repo .GetID (),
695+ Name : repo .GetName (),
696+ FullName : repo .GetFullName (),
697+ Description : repo .GetDescription (),
698+ HTMLURL : repo .GetHTMLURL (),
699+ Language : repo .GetLanguage (),
700+ Stars : repo .GetStargazersCount (),
701+ Forks : repo .GetForksCount (),
702+ OpenIssues : repo .GetOpenIssuesCount (),
703+ Private : repo .GetPrivate (),
704+ Fork : repo .GetFork (),
705+ Archived : repo .GetArchived (),
706+ DefaultBranch : repo .GetDefaultBranch (),
707+ }
708+
709+ if repo .UpdatedAt != nil {
710+ minimalRepo .UpdatedAt = repo .UpdatedAt .Format (time .RFC3339 )
711+ }
712+ if repo .CreatedAt != nil {
713+ minimalRepo .CreatedAt = repo .CreatedAt .Format (time .RFC3339 )
714+ }
715+ if repo .Topics != nil {
716+ minimalRepo .Topics = repo .Topics
717+ }
718+
719+ return minimalRepo
720+ }
721+
625722// convertToMinimalCommit converts a GitHub API RepositoryCommit to MinimalCommit
626723func convertToMinimalCommit (commit * github.RepositoryCommit , includeDiffs bool ) MinimalCommit {
627724 minimalCommit := MinimalCommit {
@@ -792,6 +889,70 @@ func convertToMinimalTag(tag *github.RepositoryTag) MinimalTag {
792889 return m
793890}
794891
892+ func convertToMinimalIssueType (issueType * github.IssueType ) MinimalIssueType {
893+ m := MinimalIssueType {
894+ ID : issueType .GetID (),
895+ NodeID : issueType .GetNodeID (),
896+ Name : issueType .GetName (),
897+ Description : issueType .GetDescription (),
898+ Color : issueType .GetColor (),
899+ }
900+
901+ if issueType .CreatedAt != nil {
902+ m .CreatedAt = issueType .CreatedAt .Format (time .RFC3339 )
903+ }
904+ if issueType .UpdatedAt != nil {
905+ m .UpdatedAt = issueType .UpdatedAt .Format (time .RFC3339 )
906+ }
907+
908+ return m
909+ }
910+
911+ func convertToMinimalCodeSearchResult (result * github.CodeSearchResult ) MinimalCodeSearchResult {
912+ minimalResult := MinimalCodeSearchResult {
913+ TotalCount : result .GetTotal (),
914+ IncompleteResults : result .GetIncompleteResults (),
915+ Items : make ([]MinimalCodeSearchItem , 0 , len (result .CodeResults )),
916+ }
917+
918+ for _ , item := range result .CodeResults {
919+ if item == nil {
920+ continue
921+ }
922+
923+ minimalItem := MinimalCodeSearchItem {
924+ Name : item .GetName (),
925+ Path : item .GetPath (),
926+ SHA : item .GetSHA (),
927+ HTMLURL : item .GetHTMLURL (),
928+ }
929+ if repo := item .GetRepository (); repo != nil {
930+ repository := convertToMinimalRepository (repo )
931+ minimalItem .Repository = & repository
932+ }
933+
934+ minimalResult .Items = append (minimalResult .Items , minimalItem )
935+ }
936+
937+ return minimalResult
938+ }
939+
940+ func convertToMinimalSearchIssuesResult (result * github.IssuesSearchResult ) MinimalSearchIssuesResult {
941+ minimalResult := MinimalSearchIssuesResult {
942+ TotalCount : result .GetTotal (),
943+ IncompleteResults : result .GetIncompleteResults (),
944+ Items : make ([]MinimalIssue , 0 , len (result .Issues )),
945+ }
946+
947+ for _ , issue := range result .Issues {
948+ if issue != nil {
949+ minimalResult .Items = append (minimalResult .Items , convertToMinimalIssue (issue ))
950+ }
951+ }
952+
953+ return minimalResult
954+ }
955+
795956// MinimalCheckRun is the trimmed output type for check run objects.
796957type MinimalCheckRun struct {
797958 ID int64 `json:"id"`
0 commit comments