Skip to content

fix(pull-requests): relax pull_request_review_write required fields for resolve_thread - #3502

Open
ningyixi wants to merge 1 commit into
github:mainfrom
ningyixi:fix/pr-review-write-resolve-thread-schema
Open

ningyixi wants to merge 1 commit into
github:mainfrom
ningyixi:fix/pr-review-write-resolve-thread-schema

Conversation

@ningyixi

Copy link
Copy Markdown

Summary

Relax pull_request_review_write advertised inputSchema.required so resolve_thread / unresolve_thread can be called with only threadId, matching the tool description and granular tools.

Why

Fixes #3501

Schema-validating MCP clients (VS Code MCP, Claude Desktop, Cursor, etc.) reject documented resolve_thread / unresolve_thread calls because the root schema required owner, repo, and pullNumber for every method, even though those methods only use threadId.

What changed

  • Root Required for pull_request_review_write is now ["method"] (same pattern as discussion_comment_write).
  • Document that owner / repo / pullNumber are required for create / submit_pending / delete_pending.
  • normalizePullRequestReviewWriteArguments validates per method: threadId for resolve/unresolve; owner+repo+pullNumber for create/submit/delete.
  • Updated toolsnaps, README / feature-flags docs, and regression tests.

MCP impact

  • Tool schema or behavior changed
    • Advertised required fields for pull_request_review_write no longer include unused repo coordinates for thread resolve/unresolve.
    • Missing repo coordinates on create/submit/delete now fail early with a clear normalize error instead of an empty GraphQL lookup.

Prompts tested (tool changes only)

  • Resolve a review thread with pull_request_review_write using only method: resolve_thread and threadId: PRRT_...
  • Create a pending review without owner/repo and confirm the call fails with owner, repo, and pullNumber are required for create method

Security / limits

  • No security or limits impact

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint (skipped; focused package tests only)
  • Tested locally with related go test ./pkg/github/ -run 'PullRequest|ReviewWrite|ResolveReview|TestPullRequestReviewWriteResolveThreadSchema|...' (pass)

Docs

  • Updated (README / docs / examples via ./script/generate-docs)

…or resolve_thread

resolve_thread and unresolve_thread only need threadId, but the advertised
inputSchema required owner/repo/pullNumber for every method. Schema-validating
MCP clients therefore rejected valid calls. Require only method at the schema
root, document per-method fields, and validate create/submit/delete vs
resolve/unresolve in the argument normalizer.

Fixes github#3501
@ningyixi
ningyixi requested a review from a team as a code owner October 14, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(pull-requests): pull_request_review_write requires owner, repo, and pullNumber in inputSchema, breaking resolve_thread and unresolve_thread

1 participant