Skip to content

Add Tool Name property for List Code Scanning Alerts tool #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 15, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add tool name resource for list code scanning alerts tool
Dylan-Rinker committed Apr 14, 2025
commit 8b13ebbdc0ffd7bd0e1b29b55c5170ce8d7b36db
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -436,6 +436,7 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
- `ref`: Git reference (string, optional)
- `state`: Alert state (string, optional)
- `severity`: Alert severity (string, optional)
- `tool_name`: The name of the tool used for code scanning (string, optional)

## Resources

Binary file added main
Binary file not shown.
19 changes: 11 additions & 8 deletions pkg/github/code_scanning_test.go
Original file line number Diff line number Diff line change
@@ -127,6 +127,7 @@ func Test_ListCodeScanningAlerts(t *testing.T) {
assert.Contains(t, tool.InputSchema.Properties, "ref")
assert.Contains(t, tool.InputSchema.Properties, "state")
assert.Contains(t, tool.InputSchema.Properties, "severity")
assert.Contains(t, tool.InputSchema.Properties, "tool_name")
assert.ElementsMatch(t, tool.InputSchema.Required, []string{"owner", "repo"})

// Setup mock alerts for success case
@@ -159,20 +160,22 @@ func Test_ListCodeScanningAlerts(t *testing.T) {
mock.WithRequestMatchHandler(
mock.GetReposCodeScanningAlertsByOwnerByRepo,
expectQueryParams(t, map[string]string{
"ref": "main",
"state": "open",
"severity": "high",
"ref": "main",
"state": "open",
"severity": "high",
"tool_name": "CodeQL",
}).andThen(
mockResponse(t, http.StatusOK, mockAlerts),
),
),
),
requestArgs: map[string]interface{}{
"owner": "owner",
"repo": "repo",
"ref": "main",
"state": "open",
"severity": "high",
"owner": "owner",
"repo": "repo",
"ref": "main",
"state": "open",
"severity": "high",
"tool_name": "CodeQL",
},
expectError: false,
expectedAlerts: mockAlerts,
Loading
Oops, something went wrong.