Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Migrate security_advisories toolset to modelcontextprotocol/go-sdk#1434

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
9 commits
Select commitHold shift + click to select a range
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
20 changes: 20 additions & 0 deletionspkg/github/__toolsnaps__/get_global_security_advisory.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
{
"annotations": {
"readOnlyHint": true,
"title": "Get a global security advisory"
},
"description": "Get a global security advisory",
"inputSchema": {
"type": "object",
"required": [
"ghsaId"
],
"properties": {
"ghsaId": {
"type": "string",
"description": "GitHub Security Advisory ID (format: GHSA-xxxx-xxxx-xxxx)."
}
}
},
"name": "get_global_security_advisory"
}
87 changes: 87 additions & 0 deletionspkg/github/__toolsnaps__/list_global_security_advisories.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
{
"annotations": {
"readOnlyHint": true,
"title": "List global security advisories"
},
"description": "List global security advisories from GitHub.",
"inputSchema": {
"type": "object",
"properties": {
"affects": {
"type": "string",
"description": "Filter advisories by affected package or version (e.g. \"package1,package2@1.0.0\")."
},
"cveId": {
"type": "string",
"description": "Filter by CVE ID."
},
"cwes": {
"type": "array",
"description": "Filter by Common Weakness Enumeration IDs (e.g. [\"79\", \"284\", \"22\"]).",
"items": {
"type": "string"
}
},
"ecosystem": {
"type": "string",
"description": "Filter by package ecosystem.",
"enum": [
"actions",
"composer",
"erlang",
"go",
"maven",
"npm",
"nuget",
"other",
"pip",
"pub",
"rubygems",
"rust"
]
},
"ghsaId": {
"type": "string",
"description": "Filter by GitHub Security Advisory ID (format: GHSA-xxxx-xxxx-xxxx)."
},
"isWithdrawn": {
"type": "boolean",
"description": "Whether to only return withdrawn advisories."
},
"modified": {
"type": "string",
"description": "Filter by publish or update date or date range (ISO 8601 date or range)."
},
"published": {
"type": "string",
"description": "Filter by publish date or date range (ISO 8601 date or range)."
},
"severity": {
"type": "string",
"description": "Filter by severity.",
"enum": [
"unknown",
"low",
"medium",
"high",
"critical"
]
},
"type": {
"type": "string",
"description": "Advisory type.",
"default": "reviewed",
"enum": [
"reviewed",
"malware",
"unreviewed"
]
},
"updated": {
"type": "string",
"description": "Filter by update date or date range (ISO 8601 date or range)."
}
}
},
"name": "list_global_security_advisories"
}
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
{
"annotations": {
"readOnlyHint": true,
"title": "List org repository security advisories"
},
"description": "List repository security advisories for a GitHub organization.",
"inputSchema": {
"type": "object",
"required": [
"org"
],
"properties": {
"direction": {
"type": "string",
"description": "Sort direction.",
"enum": [
"asc",
"desc"
]
},
"org": {
"type": "string",
"description": "The organization login."
},
"sort": {
"type": "string",
"description": "Sort field.",
"enum": [
"created",
"updated",
"published"
]
},
"state": {
"type": "string",
"description": "Filter by advisory state.",
"enum": [
"triage",
"draft",
"published",
"closed"
]
}
}
},
"name": "list_org_repository_security_advisories"
}
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
{
"annotations": {
"readOnlyHint": true,
"title": "List repository security advisories"
},
"description": "List repository security advisories for a GitHub repository.",
"inputSchema": {
"type": "object",
"required": [
"owner",
"repo"
],
"properties": {
"direction": {
"type": "string",
"description": "Sort direction.",
"enum": [
"asc",
"desc"
]
},
"owner": {
"type": "string",
"description": "The owner of the repository."
},
"repo": {
"type": "string",
"description": "The name of the repository."
},
"sort": {
"type": "string",
"description": "Sort field.",
"enum": [
"created",
"updated",
"published"
]
},
"state": {
"type": "string",
"description": "Filter by advisory state.",
"enum": [
"triage",
"draft",
"published",
"closed"
]
}
}
},
"name": "list_repository_security_advisories"
}
2 changes: 1 addition & 1 deletionpkg/github/context_tools.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,7 +47,7 @@ func GetMe(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Too
mcp.ToolHandlerFor[map[string]any, any](func(ctx context.Context, _ *mcp.CallToolRequest, _ map[string]any) (*mcp.CallToolResult, any, error) {
client, err := getClient(ctx)
if err != nil {
return utils.NewToolResultErrorFromErr("failed to get GitHub client", err), nil,err
return utils.NewToolResultErrorFromErr("failed to get GitHub client", err), nil,nil
}

user, res, err := client.Users.Get(ctx, "")
Expand Down
1 change: 0 additions & 1 deletionpkg/github/context_tools_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -111,11 +111,10 @@
_, handler := GetMe(tc.stubbedGetClientFn, translations.NullTranslationHelper)

request := createMCPRequest(tc.requestArgs)
result, _, err := handler(context.Background(), &request, tc.requestArgs)

Check failure on line 114 in pkg/github/context_tools_test.go

View workflow job for this annotation

GitHub Actions/ lint

ineffectual assignment to err (ineffassign)
textContent := getTextResult(t, result)

if tc.expectToolError {
assert.Error(t, err)
assert.True(t, result.IsError, "expected tool call result to be an error")
assert.Contains(t, textContent.Text, tc.expectedToolErrMsg)
return
Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp