search_users
Find GitHub users by search query with options to sort by followers, repositories, or join date, and filter results with pagination controls.
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
- operations/search.ts:43-45 (handler)The core handler function implementing the search_users tool logic by querying the GitHub /search/users API endpoint.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 tool input parameters (SearchUsersOptions), extending the base SearchOptions.export const SearchUsersOptions = SearchOptions.extend({ sort: z.enum(["followers", "repositories", "joined"]).optional(), });
- operations/search.ts:32-32 (schema)Alias for the SearchUsersOptions schema used throughout the codebase.export const SearchUsersSchema = SearchUsersOptions;
- index.ts:148-152 (registration)Registration of the search_users tool in the MCP server's listTools response, defining name, description, and input schema.{ name: "search_users", description: "Search for users on GitHub", inputSchema: zodToJsonSchema(search.SearchUsersSchema), },
- index.ts:300-306 (registration)Dispatch handler in the MCP server's callTool request handler 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) }], }; }