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

Function SearchIssues

pkg/github/issues.go:1530–1589  ·  view source on GitHub ↗

SearchIssues creates a tool to search for issues.

(t translations.TranslationHelperFunc)

Source from the content-addressed store, hash-verified

1528
1529// SearchIssues creates a tool to search for issues.
1530func SearchIssues(t translations.TranslationHelperFunc) inventory.ServerTool {
1531 schema := &jsonschema.Schema{
1532 Type: "object",
1533 Properties: map[string]*jsonschema.Schema{
1534 "query": {
1535 Type: "string",
1536 Description: "Search query using GitHub issues search syntax",
1537 },
1538 "owner": {
1539 Type: "string",
1540 Description: "Optional repository owner. If provided with repo, only issues for this repository are listed.",
1541 },
1542 "repo": {
1543 Type: "string",
1544 Description: "Optional repository name. If provided with owner, only issues for this repository are listed.",
1545 },
1546 "sort": {
1547 Type: "string",
1548 Description: "Sort field by number of matches of categories, defaults to best match",
1549 Enum: []any{
1550 "comments",
1551 "reactions",
1552 "reactions-+1",
1553 "reactions--1",
1554 "reactions-smile",
1555 "reactions-thinking_face",
1556 "reactions-heart",
1557 "reactions-tada",
1558 "interactions",
1559 "created",
1560 "updated",
1561 },
1562 },
1563 "order": {
1564 Type: "string",
1565 Description: "Sort order",
1566 Enum: []any{"asc", "desc"},
1567 },
1568 },
1569 Required: []string{"query"},
1570 }
1571 WithPagination(schema)
1572
1573 return NewTool(
1574 ToolsetMetadataIssues,
1575 mcp.Tool{
1576 Name: "search_issues",
1577 Description: t("TOOL_SEARCH_ISSUES_DESCRIPTION", "Search for issues in GitHub repositories using issues search syntax already scoped to is:issue"),
1578 Annotations: &mcp.ToolAnnotations{
1579 Title: t("TOOL_SEARCH_ISSUES_USER_TITLE", "Search issues"),
1580 ReadOnlyHint: true,
1581 },
1582 InputSchema: schema,
1583 },
1584 []scopes.Scope{scopes.Repo},
1585 func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
1586 result, err := searchIssuesHandler(ctx, deps, args, ifcSearchPostProcessOption(ctx, deps))
1587 return result, nil, err

Callers 4

AllToolsFunction · 0.85
Test_SearchIssuesFunction · 0.85

Calls 4

WithPaginationFunction · 0.85
NewToolFunction · 0.85
searchIssuesHandlerFunction · 0.85