Skip to main content
Glama
lemenkov
by lemenkov

close_pull_request

Close a pull request without merging it in Pagure git forges. Use this tool to end pull request workflows when changes are not needed.

Instructions

Close a pull request without merging.

Args: project: Project name pr_id: Pull request ID number to close namespace: Project namespace (default: rpms)

Returns: JSON string with close result

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYes
pr_idYes
namespaceNorpms

Implementation Reference

  • The core API logic for closing a pull request, implemented in the PagureClient class.
    async def close_pull_request(
        self,
        project: str,
        pr_id: int,
        namespace: str = "rpms",
    ) -> Dict[str, Any]:
        """Close a pull request without merging.
    
        Args:
            project: Project name
            pr_id: Pull request ID
            namespace: Project namespace
    
        Returns:
            Close result
        """
        response = await self.client.post(
            f"{self.api_base}/{namespace}/{project}/pull-request/{pr_id}/close",
            headers=self._get_headers(),
        )
        response.raise_for_status()
        return response.json()
  • MCP tool registration and wrapper function for closing a pull request.
    async def close_pull_request(
        project: str,
        pr_id: int,
        namespace: str = "rpms",
    ) -> str:
        """Close a pull request without merging.
    
        Args:
            project: Project name
            pr_id: Pull request ID number to close
            namespace: Project namespace (default: rpms)
    
        Returns:
            JSON string with close result
        """
        client = get_client()
        result = await client.close_pull_request(project, pr_id, namespace)
    
        import json
        return json.dumps(result, indent=2)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lemenkov/mcp-pagure'

If you have feedback or need assistance with the MCP directory API, please join our Discord server