MCPcopy
hub / github.com/github/github-mcp-server / listWorkflows

Function listWorkflows

pkg/github/actions.go:825–843  ·  view source on GitHub ↗
(ctx context.Context, client *github.Client, owner, repo string, pagination PaginationParams)

Source from the content-addressed store, hash-verified

823}
824
825func listWorkflows(ctx context.Context, client *github.Client, owner, repo string, pagination PaginationParams) (*mcp.CallToolResult, any, error) {
826 opts := &github.ListOptions{
827 PerPage: pagination.PerPage,
828 Page: pagination.Page,
829 }
830
831 workflows, resp, err := client.Actions.ListWorkflows(ctx, owner, repo, opts)
832 if err != nil {
833 return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to list workflows", resp, err), nil, nil
834 }
835 defer func() { _ = resp.Body.Close() }()
836
837 r, err := json.Marshal(workflows)
838 if err != nil {
839 return nil, nil, fmt.Errorf("failed to marshal workflows: %w", err)
840 }
841
842 return utils.NewToolResultText(string(r)), nil, nil
843}
844
845func listWorkflowRuns(ctx context.Context, client *github.Client, args map[string]any, owner, repo, resourceID string, pagination PaginationParams) (*mcp.CallToolResult, any, error) {
846 filterArgs, err := OptionalParam[map[string]any](args, "workflow_runs_filter")

Callers 1

ActionsListFunction · 0.85

Calls 2

NewToolResultTextFunction · 0.92
CloseMethod · 0.80

Tested by

no test coverage detected