search_users
Search for GitHub users by query, sorting by followers, repositories, or join date, and paginate results to streamline user discovery and management.
Instructions
Search for users on GitHub
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order | No | ||
| page | No | ||
| per_page | No | ||
| q | Yes | ||
| sort | No |
Implementation Reference
- src/operations/search.ts:52-54 (handler)The main handler function that executes the tool logic by calling the GitHub search users API.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 schemas for input validation of the search_users tool: SearchUsersSchema (user params) and _SearchUsersSchema (with github_pat).export const SearchUsersSchema = SearchUsersOptions; export const _SearchUsersSchema = SearchUsersSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
- src/index.ts:154-157 (registration)Registers the search_users tool in the MCP server's listTools response, providing name, description, and input schema.name: "search_users", description: "Search for users on GitHub", inputSchema: zodToJsonSchema(search.SearchUsersSchema), },
- src/index.ts:473-480 (registration)Dispatches the search_users tool call in the MCP server's CallToolRequest handler by parsing arguments and invoking the handler function.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) }], }; }