`list_commits` returns 30 commits despite `perPage` set to 1 · Issue #136 · github/github-mcp-server · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

list_commits returns 30 commits despite perPage set to 1 #136

Closed
@bocytko

Description

@bocytko

Describe the bug

list_commits does not interpret the perPage parameter correctly and returns 30 commits (default).

list_commits({
  "owner": "X",
  "repo": "Y",
  "perPage": 1
})

Maybe it's a mismatch between

mcp.WithNumber("perPage",
and
perPage, err := optionalIntParamWithDefault(request, "per_page", 30)
as a result of changes from #90.

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: Summarize the last change in the repository X/Y
  2. LLM translated the input into the function call:
list_commits({
  "owner": "X",
  "repo": "Y",
  "perPage": 1
})
  1. The output from the tool call contains 30 commits, which is the default set in
    perPage, err := optionalIntParamWithDefault(request, "per_page", 30)

Expected vs actual behavior

The perPage parameter should be correctly respected.

Logs

$ wc -c output.json
  179574 output.json

$ cat output.json | jq -r .text | jq '.[].sha' | wc -l
      30

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

      TMZ Celebrity News – Breaking Stories, Videos & Gossip

      Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

      Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

      🎥 Watch TMZ Live

      TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.