Skip to main content
Glama
tschoonj

Repology MCP Server

by tschoonj

get_repository_problems

Retrieve reported issues for a specific package repository to identify problems across distributions and package managers.

Instructions

Get problems reported for a specific repository.

Args:
    repository: Repository name (e.g., "freebsd", "debian")
    start_from: Project name to start from for pagination

Returns:
    JSON formatted list of problems for the repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repositoryYes
start_fromNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main @mcp.tool()-decorated handler function that implements the core logic for the 'get_repository_problems' tool. It fetches problems from the Repology client, handles empty results, errors, and serializes to JSON.
    @mcp.tool()
    async def get_repository_problems(
        repository: str,
        start_from: Optional[str] = None,
        ctx: Context[ServerSession, AppContext] = None,
    ) -> str:
        """Get problems reported for a specific repository.
    
        Args:
            repository: Repository name (e.g., "freebsd", "debian")
            start_from: Project name to start from for pagination
    
        Returns:
            JSON formatted list of problems for the repository
        """
        try:
            client = ctx.request_context.lifespan_context.repology_client
            problems = await client.get_repository_problems(
                repository=repository, start_from=start_from
            )
    
            if not problems:
                return json.dumps(
                    {"message": f"No problems found for repository '{repository}'"}
                )
    
            return _problems_to_json(problems)
    
        except RepologyNotFoundError:
            return json.dumps({"error": f"Repository '{repository}' 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 repository problems: {e}")
            return json.dumps({"error": f"Unexpected error: {e}"})
  • Pydantic model defining the structure and validation for Problem objects returned by the tool.
    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 function used by the handler to serialize the list of Problem objects to a formatted JSON string.
    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)
  • RepologyClient method that performs the actual HTTP API request to fetch repository problems and validates them using the Problem model.
    async def get_repository_problems(
        self, repository: str, start_from: Optional[str] = None
    ) -> ProblemsData:
        """Get problems for a specific repository.
    
        Args:
            repository: Repository name
            start_from: Project name to start from for pagination
    
        Returns:
            List of problems
        """
        endpoint = f"repository/{quote(repository)}/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 repository problems: {e}")
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions pagination behavior ('start_from' for pagination) and the return format ('JSON formatted list'), but doesn't cover important aspects like whether this is a read-only operation, rate limits, authentication requirements, or error handling. For a tool with no annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with clear sections (purpose, args, returns) and every sentence adds value. The three-sentence format is front-loaded with the core purpose, followed by parameter explanations, then return format - all without any wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, 1 required), no annotations, but with an output schema present, the description provides adequate coverage. It explains the purpose, parameters, and return format, though it could benefit from more behavioral context (like pagination details or error cases) since annotations are absent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context for both parameters beyond the schema's 0% coverage. It explains that 'repository' is a repository name with examples ('freebsd', 'debian'), and clarifies that 'start_from' is 'for pagination' with a project name. This compensates well for the schema's lack of descriptions, though it doesn't fully explain the pagination mechanism.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('problems reported for a specific repository'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'get_maintainer_problems' or 'search_projects', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_maintainer_problems' or 'search_projects'. It mentions pagination with 'start_from', but doesn't explain when pagination is needed or how this tool differs from other problem-related tools in the server.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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