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

Function SearchUsers

pkg/github/search.go:412–451  ·  view source on GitHub ↗

SearchUsers creates a tool to search for GitHub users.

(t translations.TranslationHelperFunc)

Source from the content-addressed store, hash-verified

410
411// SearchUsers creates a tool to search for GitHub users.
412func SearchUsers(t translations.TranslationHelperFunc) inventory.ServerTool {
413 schema := &jsonschema.Schema{
414 Type: "object",
415 Properties: map[string]*jsonschema.Schema{
416 "query": {
417 Type: "string",
418 Description: "User search query. Examples: 'john smith', 'location:seattle', 'followers:>100'. Search is automatically scoped to type:user.",
419 },
420 "sort": {
421 Type: "string",
422 Description: "Sort users by number of followers or repositories, or when the person joined GitHub.",
423 Enum: []any{"followers", "repositories", "joined"},
424 },
425 "order": {
426 Type: "string",
427 Description: "Sort order",
428 Enum: []any{"asc", "desc"},
429 },
430 },
431 Required: []string{"query"},
432 }
433 WithPagination(schema)
434
435 return NewTool(
436 ToolsetMetadataUsers,
437 mcp.Tool{
438 Name: "search_users",
439 Description: t("TOOL_SEARCH_USERS_DESCRIPTION", "Find GitHub users by username, real name, or other profile information. Useful for locating developers, contributors, or team members."),
440 Annotations: &mcp.ToolAnnotations{
441 Title: t("TOOL_SEARCH_USERS_USER_TITLE", "Search users"),
442 ReadOnlyHint: true,
443 },
444 InputSchema: schema,
445 },
446 []scopes.Scope{scopes.Repo},
447 func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
448 return userOrOrgHandler(ctx, "user", deps, args)
449 },
450 )
451}
452
453// SearchOrgs creates a tool to search for GitHub organizations.
454func SearchOrgs(t translations.TranslationHelperFunc) inventory.ServerTool {

Callers 2

AllToolsFunction · 0.85
Test_SearchUsersFunction · 0.85

Calls 3

WithPaginationFunction · 0.85
NewToolFunction · 0.85
userOrOrgHandlerFunction · 0.85

Tested by 1

Test_SearchUsersFunction · 0.68