get_commit
Retrieve detailed commit information from Pagure git forges by specifying project, commit hash, and namespace parameters.
Instructions
Get detailed information about a specific commit.
Args: project: Project name commit_hash: Commit hash (full or short) namespace: Project namespace (default: rpms)
Returns: JSON string with commit details
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| commit_hash | Yes | ||
| namespace | No | rpms |
Implementation Reference
- src/pagure/server.py:256-276 (handler)The MCP tool `get_commit` which serves as the entry point for the tool, calling the underlying Pagure client.
@mcp.tool() async def get_commit( project: str, commit_hash: str, namespace: str = "rpms", ) -> str: """Get detailed information about a specific commit. Args: project: Project name commit_hash: Commit hash (full or short) namespace: Project namespace (default: rpms) Returns: JSON string with commit details """ client = get_client() result = await client.get_commit(project, commit_hash, namespace) import json return json.dumps(result, indent=2) - src/pagure/client.py:296-317 (handler)The underlying PagureClient method that performs the actual API call to retrieve commit information.
async def get_commit( self, project: str, commit_hash: str, namespace: str = "rpms", ) -> Dict[str, Any]: """Get commit details. Args: project: Project name commit_hash: Commit hash namespace: Project namespace Returns: Commit details """ response = await self.client.get( f"{self.api_base}/{namespace}/{project}/c/{commit_hash}", headers=self._get_headers(), ) response.raise_for_status() return response.json()