search_users
Identify specific GitHub users by querying their profiles, sorting results by followers, repositories, or join date, and managing pagination for efficient user discovery.
Instructions
Search for users on GitHub
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order | No | ||
| page | No | ||
| per_page | No | ||
| q | Yes | ||
| sort | No |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"order": {
"enum": [
"asc",
"desc"
],
"type": "string"
},
"page": {
"minimum": 1,
"type": "number"
},
"per_page": {
"maximum": 100,
"minimum": 1,
"type": "number"
},
"q": {
"type": "string"
},
"sort": {
"enum": [
"followers",
"repositories",
"joined"
],
"type": "string"
}
},
"required": [
"q"
],
"type": "object"
}
Implementation Reference
- operations/search.ts:43-45 (handler)Core handler function that executes the 'search_users' tool logic by constructing the GitHub search/users API URL and making the request.export async function searchUsers(params: z.infer<typeof SearchUsersSchema>) { return githubRequest(buildUrl("https://api.github.com/search/users", params)); }
- operations/search.ts:11-13 (schema)Zod schema definition for search_users input parameters, extending the base SearchOptions with user-specific sort options. Exported as SearchUsersSchema.export const SearchUsersOptions = SearchOptions.extend({ sort: z.enum(["followers", "repositories", "joined"]).optional(), });
- index.ts:148-152 (registration)Registration of the 'search_users' tool in the server's listTools handler, including name, description, and input schema.{ name: "search_users", description: "Search for users on GitHub", inputSchema: zodToJsonSchema(search.SearchUsersSchema), },
- index.ts:300-306 (handler)Handler case in the main CallToolRequest switch statement that parses arguments, calls the searchUsers function, and formats the response.case "search_users": { const args = search.SearchUsersSchema.parse(request.params.arguments); const results = await search.searchUsers(args); return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }], }; }