Skip to main content
Glama
piyushgIITian

GitHub Enterprise MCP Server

search-users

Find GitHub users by search query with options to sort by followers, repositories, or join date, and paginate results for efficient user discovery.

Instructions

Search for users on GitHub

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderNo
pageNo
per_pageNo
qYes
sortNo

Implementation Reference

  • The core handler function that executes the search-users tool. It validates input using SearchUsersSchema, calls the GitHub search.users API via Octokit, formats the results, and handles errors with tryCatchAsync.
    export async function searchUsers(args: unknown): Promise<any> {
      const { q, sort, order, page, per_page } = SearchUsersSchema.parse(args);
      const github = getGitHubApi();
    
      return tryCatchAsync(async () => {
        const { data } = await github.getOctokit().search.users({
          q,
          sort: sort as any,
          order,
          page,
          per_page,
        });
    
        return {
          total_count: data.total_count,
          incomplete_results: data.incomplete_results,
          items: data.items.map((user) => ({
            login: user.login,
            id: user.id,
            avatar_url: user.avatar_url,
            html_url: user.html_url,
            type: user.type,
            site_admin: user.site_admin,
            score: user.score,
          })),
        };
      }, 'Failed to search users');
    }
  • Zod schema used for runtime input validation of the search-users tool parameters.
    export const SearchUsersSchema = z.object({
      q: z.string().min(1, 'Search query is required'),
      sort: z.enum(['followers', 'repositories', 'joined']).optional(),
      order: z.enum(['asc', 'desc']).optional(),
      page: z.number().min(1).optional(),
      per_page: z.number().min(1).max(100).optional(),
    });
  • Tool registration in the MCP server's listTools handler, defining the tool's metadata and input schema for MCP clients.
    {
      name: 'search-users',
      description: 'Search for users on GitHub',
      inputSchema: {
        type: 'object',
        properties: {
          q: {
            type: 'string',
          },
          order: {
            type: 'string',
            enum: ['asc', 'desc'],
          },
          page: {
            type: 'number',
            minimum: 1,
          },
          per_page: {
            type: 'number',
            minimum: 1,
            maximum: 100,
          },
          sort: {
            type: 'string',
            enum: ['followers', 'repositories', 'joined'],
          },
        },
        required: ['q'],
        additionalProperties: false,
      },
    },
  • Dispatch case in the callToolRequest handler that routes execution to the searchUsers function.
    case 'search-users':
      result = await searchUsers(parsedArgs);
      break;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It only states the basic purpose without mentioning authentication requirements, rate limits, pagination behavior (implied by parameters but not explained), or what the search returns. For a search tool with 5 parameters, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just 4 words, front-loading the essential purpose without any wasted words. While it's under-specified, it's not verbose or poorly structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with 5 parameters (one required), 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain what the search returns, how to use the parameters, or any behavioral context. The agent would struggle to use this tool effectively without additional information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter descriptions. The tool description doesn't mention any parameters at all, failing to compensate for the complete lack of schema documentation. Parameters like 'q' (required search query), 'sort', 'order', 'page', and 'per_page' are entirely undocumented in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Search for users on GitHub' clearly states the action (search) and resource (users on GitHub), but it's vague about scope and lacks differentiation from sibling tools like search-code, search-issues, and search-repositories. It doesn't specify what aspects of users are searchable or how this differs from other search tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, limitations, or how it compares to other search tools in the sibling list. An agent would need to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/piyushgIITian/github-enterprice-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server