You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Implement list_milestones and search_milestones commands
This commit introduces two new commands for interacting with GitHub milestones:
- `list_milestones`: Lists milestones for a repository with options for filtering by state, sorting, and pagination.
- `search_milestones`: Searches for milestones in a repository by a query string, filtering by title and description.
The changes include:
- Implementation of `ListMilestones` and `SearchMilestones` functions in `pkg/github/issues.go`.
- Addition of the new tools to the `issues` toolset in `pkg/github/tools.go`.
- Unit tests for the new functions in `pkg/github/issues_test.go`.
- Updated tool snapshots and generated documentation.
returnnil, fmt.Errorf("failed to list milestones: %w", err)
629
+
}
630
+
deferfunc() { _=resp.Body.Close() }()
631
+
632
+
ifresp.StatusCode!=http.StatusOK {
633
+
body, err:=io.ReadAll(resp.Body)
634
+
iferr!=nil {
635
+
returnnil, fmt.Errorf("failed to read response body: %w", err)
636
+
}
637
+
returnmcp.NewToolResultError(fmt.Sprintf("failed to list milestones: %s", string(body))), nil
638
+
}
639
+
640
+
r, err:=json.Marshal(milestones)
641
+
iferr!=nil {
642
+
returnnil, fmt.Errorf("failed to marshal response: %w", err)
643
+
}
644
+
645
+
returnmcp.NewToolResultText(string(r)), nil
646
+
}
647
+
}
648
+
477
649
// ListIssueTypes creates a tool to list defined issue types for an organization. This can be used to understand supported issue type values for creating or updating issues.
478
650
funcListIssueTypes(getClientGetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
0 commit comments