Skip to content

422 Validation failed when viewing most frequent contributor #135

Open
@bocytko

Description

@bocytko

Describe the bug

Query: "Who's the most frequent contributor to github/github-mcp-server?" is translated into an invalid API call against the Github API:

Error invoking MCP tool search_users: failed to search users: GET https://api.github.com/search/users?order=desc&page=1&per_page=1&q=repo%3Agithub%2Fgithub-mcp-server&sort=repositories: 422 Validation Failed [{Resource:Search Field:q Code:invalid Message:None of the search qualifiers apply to this search type.}]

Affected version

Please run docker run -i --rm ghcr.io/github/github-mcp-server ./github-mcp-server --version and paste the output below.

server version v0.1.0 (b89336793c5bc9b9abdd5100d876babbc1031f5d) 2025-04-04T15:38:21Z

Steps to reproduce the behavior

  1. Agent config:
    agent = Agent(
        name="Assistant",
        instructions=f"Answer questions about Git repositories.",
        mcp_servers=[mcp_server],
    )
  1. User input: Who's the most frequent contributor to github/github-mcp-server?

Expected vs actual behavior

Context: I tried to validate if the MCP server can handle the example in https://github.com/openai/openai-agents-python/blob/main/examples/mcp/git_example/main.py#L15 that uses git_log as tool to fetch 1,000 last commits to calculate the most frequent contributor.

I would expect github-mcp-server to generate valid API calls, even if these do not yield the result expected by the user input.

Logs

Image

{
  "error": "Error invoking MCP tool search_users: failed to search users: GET https://api.github.com/search/users?order=desc&page=1&per_page=1&q=repo%3Agithub%2Fgithub-mcp-server&sort=repositories: 422 Validation Failed [{Resource:Search Field:q Code:invalid Message:None of the search qualifiers apply to this search type.}]",
  "tool_name": "search_users"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions