search_users
Find GitHub users by username, name, or email to connect with developers, review profiles, or identify contributors for projects.
Instructions
Search for users on GitHub
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | ||
| order | No | ||
| page | No | ||
| per_page | No | ||
| sort | No |
Implementation Reference
- src/operations/search.ts:52-54 (handler)Core handler function that executes the GitHub search users API request using githubRequest and buildUrl utilities.export async function searchUsers(github_pat: string, params: z.infer<typeof SearchUsersSchema>) { return githubRequest(github_pat, buildUrl("https://api.github.com/search/users", params)); }
- src/operations/search.ts:35-38 (schema)Zod schema definitions for search_users tool: SearchUsersSchema (public input) and _SearchUsersSchema (internal with github_pat).export const SearchUsersSchema = SearchUsersOptions; export const _SearchUsersSchema = SearchUsersSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
- src/operations/search.ts:11-13 (schema)Zod schema extension defining user-specific options for search_users (sort by followers, repositories, or joined date).export const SearchUsersOptions = SearchOptions.extend({ sort: z.enum(["followers", "repositories", "joined"]).optional(), });
- src/index.ts:153-157 (registration)Tool registration entry in the ListTools response, specifying name, description, and input schema.{ name: "search_users", description: "Search for users on GitHub", inputSchema: zodToJsonSchema(search.SearchUsersSchema), },
- src/index.ts:473-479 (handler)Dispatcher case in CallToolRequest handler that parses arguments, extracts github_pat, calls the searchUsers handler, and formats the response.case "search_users": { const argsWithPat = search._SearchUsersSchema.parse(params.arguments); const { github_pat, ...args } = argsWithPat; const results = await search.searchUsers(github_pat, args); return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }], };