MCPcopy Index your code
hub / github.com/github/github-mcp-server / ListDependabotAlerts

Function ListDependabotAlerts

pkg/github/dependabot.go:103–214  ·  view source on GitHub ↗
(t translations.TranslationHelperFunc)

Source from the content-addressed store, hash-verified

101}
102
103func ListDependabotAlerts(t translations.TranslationHelperFunc) inventory.ServerTool {
104 schema := &jsonschema.Schema{
105 Type: "object",
106 Properties: map[string]*jsonschema.Schema{
107 "owner": {
108 Type: "string",
109 Description: "The owner of the repository.",
110 },
111 "repo": {
112 Type: "string",
113 Description: "The name of the repository.",
114 },
115 "state": {
116 Type: "string",
117 Description: "Filter dependabot alerts by state. Defaults to open",
118 Enum: []any{"open", "fixed", "dismissed", "auto_dismissed"},
119 Default: json.RawMessage(`"open"`),
120 },
121 "severity": {
122 Type: "string",
123 Description: "Filter dependabot alerts by severity",
124 Enum: []any{"low", "medium", "high", "critical"},
125 },
126 },
127 Required: []string{"owner", "repo"},
128 }
129 WithCursorPagination(schema)
130
131 return NewTool(
132 ToolsetMetadataDependabot,
133 mcp.Tool{
134 Name: "list_dependabot_alerts",
135 Description: t("TOOL_LIST_DEPENDABOT_ALERTS_DESCRIPTION", "List dependabot alerts in a GitHub repository."),
136 Annotations: &mcp.ToolAnnotations{
137 Title: t("TOOL_LIST_DEPENDABOT_ALERTS_USER_TITLE", "List dependabot alerts"),
138 ReadOnlyHint: true,
139 },
140 InputSchema: schema,
141 },
142 []scopes.Scope{scopes.SecurityEvents},
143 func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
144 owner, err := RequiredParam[string](args, "owner")
145 if err != nil {
146 return utils.NewToolResultError(err.Error()), nil, nil
147 }
148 repo, err := RequiredParam[string](args, "repo")
149 if err != nil {
150 return utils.NewToolResultError(err.Error()), nil, nil
151 }
152 state, err := OptionalParam[string](args, "state")
153 if err != nil {
154 return utils.NewToolResultError(err.Error()), nil, nil
155 }
156 severity, err := OptionalParam[string](args, "severity")
157 if err != nil {
158 return utils.NewToolResultError(err.Error()), nil, nil
159 }
160

Callers 2

AllToolsFunction · 0.85

Calls 14

NewToolResultErrorFunction · 0.92
NewToolResultTextFunction · 0.92
LabelSecurityAlertFunction · 0.92
WithCursorPaginationFunction · 0.85
NewToolFunction · 0.85
ToStringPtrFunction · 0.85
dependabotErrMsgFunction · 0.85
buildPageInfoFunction · 0.85
attachStaticIFCLabelFunction · 0.85
CloseMethod · 0.80

Tested by 1