Repository navigation
bug(pull-requests): pull_request_review_write requires owner, repo, and pullNumber in inputSchema, breaking resolve_thread and unresolve_thread #3501
Description
In pull_request_review_write, the tool's JSON inputSchema unconditionally marks owner, repo, and pullNumber as required for all methods:
// pkg/github/pullrequests.go:2046
Required: []string{"method", "owner", "repo", "pullNumber"},However, the tool description documents that resolve_thread and unresolve_thread only need threadId:
- resolve_thread: Resolve a review thread. Requires only "threadId" parameter with the thread's node ID (e.g., PRRT_kwDOxxx). The owner, repo, and pullNumber parameters are not used for this method. Resolving an already-resolved thread is a no-op.
- unresolve_thread: Unresolve a previously resolved review thread. Requires only "threadId" parameter. The owner, repo, and pullNumber parameters are not used for this method. Unresolving an already-unresolved thread is a no-op.
The handler (ResolveReviewThread / ResolveReviewThreadWithReason) runs a GraphQL mutation that only takes threadId:
mutation($input: ResolveReviewThreadInput!) {
resolveReviewThread(input: $input) { ... }
}owner, repo, and pullNumber are neither passed nor needed.
Impact
- Valid calls are rejected by schema-validating MCP clients. Clients that enforce JSON Schema validation (VS Code MCP extension, Claude Desktop, Cursor, Goose, OpenAI/LangChain agents) reject calls that follow the documented contract:
{
"method": "resolve_thread",
"threadId": "PRRT_kwDO123456"
}with: Missing required parameters: owner, repo, pullNumber.
-
Invalid calls pass validation.
threadIdis not inrequired, so a call with dummyowner/repo/pullNumberbut nothreadIdpasses client-side validation and only fails at runtime. -
Inconsistent with other tools:
- The granular equivalents (
GranularResolveReviewThreadandGranularUnresolveReviewThreadinpkg/github/pullrequests_granular.go) correctly declare onlyRequired: []string{"threadID"}. - Other consolidated dispatch tools (e.g.,
issue_write) don't globally require method-specific fields likeissue_number(Required: []string{"method", "owner", "repo"}).
- The granular equivalents (
Affected version
v2.0.1 / latest main
Steps to reproduce the behavior
- Connect an MCP client with schema validation enabled (Claude Desktop, VS Code MCP, etc.) to
github-mcp-server. - Inspect the advertised schema for
pull_request_review_write.inputSchema.requiredis["method", "owner", "repo", "pullNumber"]. - Prompt an agent to resolve a review thread using
pull_request_review_writewithmethod: "resolve_thread"andthreadId: "PRRT_...". - Observe the client-side validation failure because
owner,repo, andpullNumberwere not provided.
Expected behavior
Calling pull_request_review_write with {"method": "resolve_thread", "threadId": "PRRT_..."} or {"method": "unresolve_thread", "threadId": "PRRT_..."} should pass schema validation without requiring dummy owner, repo, and pullNumber arguments.
Actual behavior
The tool cannot be invoked for resolve_thread or unresolve_thread without supplying unused dummy parameters (owner, repo, pullNumber) to bypass client-side schema validation.
Affected files
pkg/github/pullrequests.go(lines 2046–2075)pkg/github/consolidated_pull_request_types.go(lines 582–622)pkg/github/__toolsnaps__/pull_request_review_write.snap
Proposed fix
- In
pkg/github/pullrequests.go, relax the rootRequiredfields ofpull_request_review_writeto[]string{"method"}(or use a relaxed input validation schema option viaNewToolWithSchemaOptions). - In
normalizePullRequestReviewWriteArgumentsor in the handler, validate per method:- For
create,submit_pending, anddelete_pending: requireowner,repo, andpullNumber. - For
resolve_threadandunresolve_thread: requirethreadId.
- For
- Update the tool snapshot
pkg/github/__toolsnaps__/pull_request_review_write.snap.
I'm happy to share a PR for this if the approach above looks good to the maintainers.
Activity
fix(pull-requests): relax pull_request_review_write required fields f…