Claude misinterprets ADO PR status enum (1=Active read as "merged")

Resolved 💬 1 comment Opened May 19, 2026 by TimZander Closed Jun 18, 2026

Problem

The Microsoft azure-devops MCP server (mcp__azure-devops__repo_get_pull_request_by_id) returns ADO PR state as raw numeric enums:

  • status: 1 — Active (open)
  • status: 2 — Abandoned
  • status: 3 — Completed (merged)
  • mergeStatus: 3 — Succeeded (the preview merge computed cleanly, NOT that the PR has merged)
  • lastMergeCommit — present on open PRs too; it's the preview commit, not a record of an actual merge

In practice Claude (Opus, Sonnet) repeatedly reads status: 1 as "completed/merged" — probably because 1 reads like "true/first state" without enum context, and the adjacent mergeStatus: 3 + populated lastMergeCommit reinforce the wrong conclusion.

Impact

Claude confidently tells the user "this PR is merged" when it is open and awaiting review. This is not a one-off; it has happened multiple times in a single day for this user, and any ADO MCP user is exposed to the same defect.

Suggested fixes (any of)

  1. Translate enums in the MCP response. Return "status": "active" (string) or add "statusName": "Active" alongside the integer.
  2. System-prompt guidance in Claude Code when the ADO MCP server is configured — inline the enum tables for PullRequestStatus and PullRequestAsyncStatus so the model has the mapping in context.
  3. Document the gotcha in the ADO MCP server README so wrappers/users can normalize on their side.

Option 1 is the durable fix and applies to every model/host calling the server.

Reference

ADO REST API enum reference: Microsoft.TeamFoundation.SourceControl.WebApi.PullRequestStatus and PullRequestAsyncStatus.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗