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

Function SearchOrgs

pkg/github/search.go:454–493  ·  view source on GitHub ↗

SearchOrgs creates a tool to search for GitHub organizations.

(t translations.TranslationHelperFunc)

Source from the content-addressed store, hash-verified

452
453// SearchOrgs creates a tool to search for GitHub organizations.
454func SearchOrgs(t translations.TranslationHelperFunc) inventory.ServerTool {
455 schema := &jsonschema.Schema{
456 Type: "object",
457 Properties: map[string]*jsonschema.Schema{
458 "query": {
459 Type: "string",
460 Description: "Organization search query. Examples: 'microsoft', 'location:california', 'created:>=2025-01-01'. Search is automatically scoped to type:org.",
461 },
462 "sort": {
463 Type: "string",
464 Description: "Sort field by category",
465 Enum: []any{"followers", "repositories", "joined"},
466 },
467 "order": {
468 Type: "string",
469 Description: "Sort order",
470 Enum: []any{"asc", "desc"},
471 },
472 },
473 Required: []string{"query"},
474 }
475 WithPagination(schema)
476
477 return NewTool(
478 ToolsetMetadataOrgs,
479 mcp.Tool{
480 Name: "search_orgs",
481 Description: t("TOOL_SEARCH_ORGS_DESCRIPTION", "Find GitHub organizations by name, location, or other organization metadata. Ideal for discovering companies, open source foundations, or teams."),
482 Annotations: &mcp.ToolAnnotations{
483 Title: t("TOOL_SEARCH_ORGS_USER_TITLE", "Search organizations"),
484 ReadOnlyHint: true,
485 },
486 InputSchema: schema,
487 },
488 []scopes.Scope{scopes.ReadOrg},
489 func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
490 return userOrOrgHandler(ctx, "org", deps, args)
491 },
492 )
493}
494
495// SearchCommits creates a tool to search for commits across GitHub repositories.
496func SearchCommits(t translations.TranslationHelperFunc) inventory.ServerTool {

Callers 2

AllToolsFunction · 0.85
Test_SearchOrgsFunction · 0.85

Calls 3

WithPaginationFunction · 0.85
NewToolFunction · 0.85
userOrOrgHandlerFunction · 0.85

Tested by 1

Test_SearchOrgsFunction · 0.68