Skip to main content
Glama
tschoonj

Repology MCP Server

by tschoonj

get_project

Retrieve detailed package information for a specific project from Repology's database, optionally filtered by repository.

Instructions

Get detailed information about a specific project.

Args:
    project_name: Exact name of the project to retrieve
    repository: Optional repository filter to show only packages from that repository

Returns:
    JSON formatted list of packages for the project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_nameYes
repositoryNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary MCP tool handler for 'get_project'. It retrieves packages for a project using RepologyClient, applies optional repository filtering, formats as JSON, and handles errors.
    @mcp.tool()
    async def get_project(
        project_name: str,
        repository: Optional[str] = None,
        ctx: Context[ServerSession, AppContext] = None,
    ) -> str:
        """Get detailed information about a specific project.
    
        Args:
            project_name: Exact name of the project to retrieve
            repository: Optional repository filter to show only packages from that repository
    
        Returns:
            JSON formatted list of packages for the project
        """
        try:
            client = ctx.request_context.lifespan_context.repology_client
            packages = await client.get_project(project_name)
    
            if not packages:
                return json.dumps(
                    {"message": f"No packages found for project '{project_name}'"}
                )
    
            # Apply client-side repository filtering if repository is specified
            if repository:
                packages = _filter_packages_by_repo(packages, repository)
                if not packages:
                    return json.dumps(
                        {
                            "message": f"No packages found for project '{project_name}' in repository '{repository}'"
                        }
                    )
    
            return _packages_to_json(packages)
    
        except RepologyNotFoundError:
            return json.dumps({"error": f"Project '{project_name}' 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 project: {e}")
            return json.dumps({"error": f"Unexpected error: {e}"})
  • Pydantic model defining the structure of individual package objects returned by the get_project tool.
    class Package(BaseModel):
        """A package in a repository."""
    
        repo: str = Field(description="Repository name")
        subrepo: Optional[str] = Field(None, description="Subrepository name")
        srcname: Optional[str] = Field(None, description="Source package name")
        binname: Optional[str] = Field(None, description="Binary package name")
        binnames: Optional[List[str]] = Field(None, description="All binary package names")
        visiblename: str = Field(description="Package name as shown by Repology")
        version: str = Field(description="Package version (sanitized)")
        origversion: Optional[str] = Field(None, description="Original package version")
        status: Literal[
            "newest",
            "devel",
            "unique",
            "outdated",
            "legacy",
            "rolling",
            "noscheme",
            "incorrect",
            "untrusted",
            "ignored",
        ] = Field(description="Package status")
        summary: Optional[str] = Field(None, description="Package description")
        categories: Optional[List[str]] = Field(None, description="Package categories")
        licenses: Optional[List[str]] = Field(None, description="Package licenses")
        maintainers: Optional[List[str]] = Field(None, description="Package maintainers")
  • Helper function used by get_project to serialize the list of Package models to a formatted JSON string.
    def _packages_to_json(packages: List[Package]) -> str:
        """Convert packages list to formatted JSON string."""
        return json.dumps([pkg.model_dump() for pkg in packages], indent=2)
  • Helper function used by get_project to filter packages by the optional 'repository' parameter.
    def _filter_packages_by_repo(packages: List[Package], repo: str) -> List[Package]:
        """Filter packages to only include those from a specific repository."""
        return [pkg for pkg in packages if pkg.repo == repo]
  • RepologyClient.get_project method called by the MCP handler to fetch raw project data from the Repology API and validate into Package models.
    async def get_project(self, project_name: str) -> ProjectData:
        """Get package data for a specific project.
    
        Args:
            project_name: Name of the project
    
        Returns:
            List of packages for the project
    
        Raises:
            RepologyNotFoundError: If project doesn't exist
        """
        endpoint = f"project/{quote(project_name)}"
    
        try:
            data = await self._make_request(endpoint)
            # API returns a list of package dictionaries
            if not isinstance(data, list):
                raise RepologyAPIError(f"Expected list, got {type(data)}")
    
            packages = []
            for item in data:
                try:
                    packages.append(Package.model_validate(item))
                except ValidationError as e:
                    # Log validation error but continue with other packages
                    print(f"Warning: Failed to validate package data: {e}")
                    continue
    
            return packages
    
        except RepologyNotFoundError:
            # Re-raise not found errors
            raise
        except RepologyRateLimitError:
            # Re-raise rate limit errors
            raise
        except Exception as e:
            raise RepologyAPIError(f"Failed to get project {project_name}: {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 states this is a read operation ('Get'), but doesn't mention authentication requirements, rate limits, error conditions, or whether this is a real-time query versus cached data. The description adds minimal behavioral context beyond the basic operation.

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

Conciseness4/5

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

The description is well-structured with clear sections (Args, Returns) and front-loaded the core purpose. Every sentence earns its place, though the 'Returns' section could be slightly more detailed given there's an output schema. Overall efficient but not perfectly concise.

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 has an output schema (which handles return value documentation) and the description provides good parameter semantics, this is reasonably complete. However, for a tool with no annotations, it could benefit from more behavioral context about authentication, errors, or performance characteristics to be fully complete.

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

Parameters5/5

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

The description provides excellent parameter semantics despite 0% schema description coverage. It clearly explains that 'project_name' requires an exact name and 'repository' is an optional filter to show only packages from that repository. This adds significant value beyond the bare schema, fully compensating for the lack of schema descriptions.

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 'Get detailed information about a specific project' - a specific verb ('Get') and resource ('project'). It distinguishes from siblings like 'list_projects' (which likely lists multiple projects) and 'search_projects' (which searches rather than retrieves a specific one). However, it doesn't explicitly mention how it differs from 'get_maintainer_problems' or 'get_repository_problems'.

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

Usage Guidelines3/5

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

The description implies usage context through the parameter descriptions - you need an exact project name and can optionally filter by repository. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like 'list_projects' or 'search_projects', nor does it mention prerequisites or exclusions.

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