Skip to main content
Glama
oborchers

mcp-server-pacman

package_info

Get detailed information about a specific package from PyPI, npm, crates.io, or Terraform Registry, including the latest version or a specific version.

Instructions

Get detailed information about a specific package

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYesPackage index to query (pypi, npm, crates, terraform)
nameYesPackage name
versionNoSpecific version to get info for (default: latest)

Implementation Reference

  • The call_tool handler for 'package_info' - validates arguments via PackageInfo model, dispatches to the appropriate provider function (get_pypi_info, get_npm_info, get_crates_info, get_terraform_module_info) based on the index field, and returns the result as a TextContent response.
    elif name == "package_info":
        try:
            args = PackageInfo(**arguments)
            logger.debug(f"Validated package info args: {args}")
        except ValueError as e:
            logger.error(f"Invalid package info parameters: {str(e)}")
            raise McpError(ErrorData(code=INVALID_PARAMS, message=str(e)))
    
        logger.info(
            f"Getting package info for {args.name} on {args.index}"
            + (f" (version={args.version})" if args.version else "")
        )
    
        if args.index == "pypi":
            info = await get_pypi_info(args.name, args.version)
        elif args.index == "npm":
            info = await get_npm_info(args.name, args.version)
        elif args.index == "crates":
            info = await get_crates_info(args.name, args.version)
        elif args.index == "terraform":
            if args.version:
                logger.info(
                    "Version-specific info for Terraform modules is not supported yet"
                )
            info = await get_terraform_module_info(args.name)
        else:
            logger.error(f"Unsupported package index: {args.index}")
            raise McpError(
                ErrorData(
                    code=INVALID_PARAMS,
                    message=f"Unsupported package index: {args.index}",
                )
            )
    
        logger.info(
            f"Successfully retrieved package info for {args.name} on {args.index}"
        )
        return [
            TextContent(
                type="text",
                text=f"Package information for {args.name} on {args.index}:\n{json.dumps(info, indent=2)}",
            )
        ]
  • PackageInfo Pydantic model defining the input schema for the 'package_info' tool. Fields: index (Literal['pypi','npm','crates','terraform']), name (str), version (Optional[str], default None).
    class PackageInfo(BaseModel):
        """Parameters for getting package information."""
    
        index: Annotated[
            Literal["pypi", "npm", "crates", "terraform"],
            Field(description="Package index to query (pypi, npm, crates, terraform)"),
        ]
        name: Annotated[str, Field(description="Package name")]
        version: Annotated[
            Optional[str],
            Field(
                default=None,
                description="Specific version to get info for (default: latest)",
            ),
        ]
  • Registration of the 'package_info' tool in the list_tools handler, with name='package_info', description and inputSchema derived from PackageInfo.model_json_schema().
    Tool(
        name="package_info",
        description="Get detailed information about a specific package",
        inputSchema=PackageInfo.model_json_schema(),
  • PackageInfo re-exported from the models package's __init__.py for convenient import.
    """Data models for mcp-server-pacman."""
    
    from .package_models import (
        PackageSearch,
        PackageInfo,
        DockerImageSearch,
        DockerImageInfo,
        TerraformModuleLatestVersion,
    )
    
    __all__ = [
        "PackageSearch",
        "PackageInfo",
        "DockerImageSearch",
        "DockerImageInfo",
        "TerraformModuleLatestVersion",
    ]
  • get_pypi_info - provider function called when index='pypi'. Fetches package details from PyPI JSON API.
    @async_cached(http_cache)
    async def get_pypi_info(name: str, version: Optional[str] = None) -> Dict:
        """Get information about a package from PyPI."""
        async with httpx.AsyncClient() as client:
            url = f"https://pypi.org/pypi/{name}/json"
            if version:
                url = f"https://pypi.org/pypi/{name}/{version}/json"
    
            response = await client.get(
                url,
                headers={"Accept": "application/json", "User-Agent": DEFAULT_USER_AGENT},
                follow_redirects=True,
            )
    
            if response.status_code != 200:
                raise McpError(
                    ErrorData(
                        code=INTERNAL_ERROR,
                        message=f"Failed to get package info from PyPI - status code {response.status_code}",
                    )
                )
    
            try:
                data = response.json()
                result = {
                    "name": data["info"]["name"],
                    "version": data["info"]["version"],
                    "description": data["info"]["summary"],
                    "author": data["info"]["author"],
                    "homepage": data["info"]["home_page"],
                    "license": data["info"]["license"],
                    "releases": list(data["releases"].keys()),
                }
                return result
            except Exception as e:
                raise McpError(
                    ErrorData(
                        code=INTERNAL_ERROR,
                        message=f"Failed to parse PyPI package info: {str(e)}",
                    )
                )
Behavior2/5

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

No annotations are provided, and the description does not disclose any behavioral traits beyond the basic action. It does not confirm whether the operation is read-only, destructive, or has any side effects, which is a significant gap for a tool likely performing external queries.

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 a single, concise sentence with no wasted words. It is efficiently front-loaded with the action and resource.

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

Completeness2/5

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

The tool has no output schema, yet the description only vaguely says 'detailed information'. It does not specify what fields or structure the response contains, leaving the agent without adequate context for handling the result.

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

Parameters3/5

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

The input schema has 100% description coverage for parameters, so the description adds no additional meaning beyond what the schema already provides. Baseline score of 3 is appropriate.

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 verb 'Get' and resource 'detailed information about a specific package'. It is specific enough to distinguish from sibling tools like 'search_package' and 'docker_image_info', though it does not explicitly differentiate them.

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?

No guidance is provided on when to use this tool vs alternatives. There is no mention of prerequisites, context, or exclusions, leaving the agent without decision support.

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/oborchers/mcp-server-pacman'

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