Skip to main content
Glama
oborchers

mcp-server-pacman

package_info

Retrieve detailed information about software packages from PyPI, npm, crates.io, or Terraform by specifying the package name and optional version.

Instructions

Get detailed information about a specific package

Input Schema

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

Input Schema (JSON Schema)

{ "description": "Parameters for getting package information.", "properties": { "index": { "description": "Package index to query (pypi, npm, crates, terraform)", "enum": [ "pypi", "npm", "crates", "terraform" ], "title": "Index", "type": "string" }, "name": { "description": "Package name", "title": "Name", "type": "string" }, "version": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Specific version to get info for (default: latest)", "title": "Version" } }, "required": [ "index", "name" ], "title": "PackageInfo", "type": "object" }

Implementation Reference

  • Registration of the 'package_info' tool in the list_tools() function, including name, description, and input schema from PackageInfo model.
    Tool( name="package_info", description="Get detailed information about a specific package", inputSchema=PackageInfo.model_json_schema(), ),
  • Pydantic BaseModel defining the input parameters for the package_info tool: index, name, and optional version.
    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)", ), ]
  • Implementation of the package_info tool handler: validates arguments with PackageInfo schema, fetches info from providers based on index (pypi, npm, crates, terraform), and returns JSON-formatted 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)}", ) ]

Other Tools

Related 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