Skip to content

list_pull_requests reports merged pull requests as merged: false #3467

Description

@po-et

Describe the bug

list_pull_requests reports merged: false for merged pull requests. This can make an agent classify merged changes as closed without merging when it summarizes a repository's contribution history.

The REST list response includes merged_at but omits the merged boolean. convertToMinimalPullRequest currently uses pr.GetMerged(), whose default for the omitted field is false. The incorrect value appears in both text and structured output, including when selecting the merged field.

Affected version

Reproduced from source at main commit eb47a99ddb866ca2b8a162920e6bda9521f33ebb, using Go 1.27.1. This report is based on the REST response and tool-handler regression rather than a Docker release.

Steps to reproduce the behavior

  1. Use list_pull_requests with state: "all" or state: "closed" for a repository containing merged pull requests.

  2. The REST list returns a merged entry in this shape:

    {"number":3454,"state":"closed","merged_at":"2026-10-08T11:25:51Z"}
  3. The conversion produces merged: false despite the non-null merge timestamp. I reproduced the conversion with four merged entries from github/github-mcp-server (fix(inventory): restore typed tool HTTP header validation #3454, fix(go)!: migrate to the v2 module path #3445, ci(mcp-diff): prebuild HTTP server and fail when a side is unreachable #3440, Address typed output compatibility gaps #3433), and added a regression that passes this raw JSON shape through the list tool and an in-memory MCP session.

Expected vs actual behavior

Expected: an entry with a valid merged_at and no explicit merged flag reports merged: true.

Actual: the tool reports merged: false.

Open entries and closed entries with merged_at: null should continue to report false. If the API supplies an explicit merged value, it should remain authoritative.

Logs

The regression fails on current main for both the full response and selected fields, in text and structured output:

Test_ListPullRequests_MergedState/merged_list_entry/all_fields
expected: true
actual  : false
Test_ListPullRequests_MergedState/merged_list_entry/selected_fields
expected: true
actual  : false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions