resolve_review_thread
Mark GitHub pull request review threads as resolved to manage code review discussions and track feedback completion.
Instructions
Mark a review thread as resolved
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| thread_id | Yes | Review thread ID (from list_review_threads) |
Implementation Reference
- src/pr_review_mcp/tools.py:200-215 (handler)The MCP tool handler function that processes the resolve_review_thread tool call, extracts the thread_id argument, calls GitHubAPI.resolve_thread(), and returns a formatted JSON response.async def handle_resolve_review_thread( api: GitHubAPI, arguments: dict[str, Any] ) -> list[TextContent]: """Handle resolve_review_thread tool call.""" thread_id = arguments["thread_id"] # Resolve thread thread = api.resolve_thread(thread_id) result = { "success": True, "thread": {"id": thread.get("id"), "is_resolved": thread.get("isResolved", False)}, } return [TextContent(type="text", text=json.dumps(result, indent=2))]
- src/pr_review_mcp/tools.py:66-79 (schema)Input schema definition for the resolve_review_thread tool, specifying the required thread_id parameter.Tool( name="resolve_review_thread", description="Mark a review thread as resolved", inputSchema={ "type": "object", "properties": { "thread_id": { "type": "string", "description": "Review thread ID (from list_review_threads)", } }, "required": ["thread_id"], }, ),
- src/pr_review_mcp/tools.py:115-116 (registration)Dispatch logic in the @server.call_tool() handler that routes calls to 'resolve_review_thread' to the specific handler function.elif name == "resolve_review_thread": return await handle_resolve_review_thread(api, arguments)
- src/pr_review_mcp/gh_api.py:201-232 (helper)GitHubAPI.resolve_thread method that executes the GraphQL resolveReviewThread mutation to mark the review thread as resolved.def resolve_thread(self, thread_id: str) -> dict[str, Any]: """ Resolve a review thread. Args: thread_id: Review thread node ID Returns: Updated thread object """ query = """ mutation ResolveThread($threadId: ID!) { resolveReviewThread(input: { threadId: $threadId }) { thread { id isResolved } } } """ variables = {"threadId": thread_id} data = self.execute_graphql(query, variables) thread = data.get("resolveReviewThread", {}).get("thread", {}) if not thread: raise GitHubAPIError("Failed to resolve thread") return thread