Skip to main content
Glama
tschoonj

Repology MCP Server

by tschoonj

get_maintainer_problems

Retrieve reported package issues for a specific maintainer to identify and address problems in repositories. Filter by repository or paginate results as needed.

Instructions

Get problems reported for packages maintained by a specific person.

Args:
    maintainer: Maintainer email address
    repository: Optional repository to limit results to
    start_from: Project name to start from for pagination

Returns:
    JSON formatted list of problems for the maintainer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maintainerYes
repositoryNo
start_fromNo

Implementation Reference

  • Primary MCP tool handler for 'get_maintainer_problems'. Registers the tool via @mcp.tool(), executes the logic by delegating to RepologyClient, handles exceptions, and returns JSON-formatted problems list.
    @mcp.tool()
    async def get_maintainer_problems(
        maintainer: str,
        repository: Optional[str] = None,
        start_from: Optional[str] = None,
        ctx: Context[ServerSession, AppContext] = None,
    ) -> str:
        """Get problems reported for packages maintained by a specific person.
    
        Args:
            maintainer: Maintainer email address
            repository: Optional repository to limit results to
            start_from: Project name to start from for pagination
    
        Returns:
            JSON formatted list of problems for the maintainer
        """
        try:
            client = ctx.request_context.lifespan_context.repology_client
            problems = await client.get_maintainer_problems(
                maintainer=maintainer, repository=repository, start_from=start_from
            )
    
            if not problems:
                msg = f"No problems found for maintainer '{maintainer}'"
                if repository:
                    msg += f" in repository '{repository}'"
                return json.dumps({"message": msg})
    
            return _problems_to_json(problems)
    
        except RepologyNotFoundError:
            return json.dumps({"error": f"Maintainer '{maintainer}' not found"})
        except RepologyAPIError as e:
            await ctx.error(f"Repology API error: {e}")
            return json.dumps({"error": str(e)})
        except Exception as e:
            await ctx.error(f"Unexpected error getting maintainer problems: {e}")
            return json.dumps({"error": f"Unexpected error: {e}"})
  • RepologyClient helper method that constructs the API endpoint, makes the HTTP request to Repology, validates response data using Problem models, and returns list of Problem objects.
    async def get_maintainer_problems(
        self,
        maintainer: str,
        repository: Optional[str] = None,
        start_from: Optional[str] = None,
    ) -> ProblemsData:
        """Get problems for packages maintained by a specific person.
    
        Args:
            maintainer: Maintainer email address
            repository: Optional repository to limit results to
            start_from: Project name to start from for pagination
    
        Returns:
            List of problems
        """
        if repository:
            endpoint = (
                f"maintainer/{quote(maintainer)}/problems-for-repo/{quote(repository)}"
            )
        else:
            endpoint = f"maintainer/{quote(maintainer)}/problems"
    
        params = {}
        if start_from:
            params["start"] = start_from
    
        try:
            data = await self._make_request(endpoint, params)
    
            if not isinstance(data, list):
                raise RepologyAPIError(f"Expected list, got {type(data)}")
    
            problems = []
            for item in data:
                try:
                    problems.append(Problem.model_validate(item))
                except ValidationError as e:
                    print(f"Warning: Failed to validate problem data: {e}")
                    continue
    
            return problems
    
        except Exception as e:
            raise RepologyAPIError(f"Failed to get maintainer problems: {e}")
  • Pydantic schema/model for Problem objects, used to validate and structure the data returned by the Repology API in get_maintainer_problems.
    class Problem(BaseModel):
        """A problem reported for a package."""
    
        type: str = Field(description="Problem type")
        data: Dict[str, Any] = Field(description="Additional problem details")
        project_name: str = Field(description="Repology project name")
        version: str = Field(description="Package version")
        srcname: Optional[str] = Field(None, description="Source package name")
        binname: Optional[str] = Field(None, description="Binary package name")
        rawversion: Optional[str] = Field(None, description="Raw package version")
  • Helper utility to serialize list of Problem models to pretty-printed JSON string for the tool response.
    def _problems_to_json(problems: List[Problem]) -> str:
        """Convert problems list to formatted JSON string."""
        return json.dumps([prob.model_dump() for prob in problems], indent=2)
  • MCP tool registration decorator that registers the get_maintainer_problems function as an MCP tool.
    @mcp.tool()

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/tschoonj/repology-mcp-server'

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