Skip to main content
Glama
hd-deman

ArtifactHub MCP Server

by hd-deman

helm-chart-info

Retrieve Helm chart metadata from Artifact Hub, including version details and descriptions for specified chart repositories and names.

Instructions

Get information about a Helm chart from Artifact Hub, including ID, latest version, and description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chartRepoYesThe Helm chart repository name
chartNameYesThe Helm chart name

Implementation Reference

  • The handler logic for helm-chart-info which calls getChartInfo and formats the response.
    	async ({ chartRepo, chartName }: InfoParams) => {
    		try {
    			const data = await getChartInfo(chartRepo, chartName);
    
    			return {
    				content: [
    					{
    						type: "text",
    						text: JSON.stringify(
    							{
    								id: data.package_id,
    								latest_version: data.version,
    								description: data.description,
    							},
    							null,
    							2
    						),
    					},
    				],
    			};
    		} catch (error) {
    			return {
    				content: [
    					{
    						type: "text",
    						text: `Error retrieving chart info: ${(error as Error).message}`,
    					},
    				],
    			};
    		}
    	}
    );
  • src/tools/info.ts:7-46 (registration)
    The registration of the helm-chart-info tool.
    export function registerInfoTool(server: McpServer) {
    	return server.tool(
    		"helm-chart-info",
    		"Get information about a Helm chart from Artifact Hub, including ID, latest version, and description",
    		{
    			chartRepo: z.string().describe("The Helm chart repository name"),
    			chartName: z.string().describe("The Helm chart name"),
    		},
    		async ({ chartRepo, chartName }: InfoParams) => {
    			try {
    				const data = await getChartInfo(chartRepo, chartName);
    
    				return {
    					content: [
    						{
    							type: "text",
    							text: JSON.stringify(
    								{
    									id: data.package_id,
    									latest_version: data.version,
    									description: data.description,
    								},
    								null,
    								2
    							),
    						},
    					],
    				};
    			} catch (error) {
    				return {
    					content: [
    						{
    							type: "text",
    							text: `Error retrieving chart info: ${(error as Error).message}`,
    						},
    					],
    				};
    			}
    		}
    	);
  • The helper function that performs the API request to retrieve chart information.
    export async function getChartInfo(
    	chartRepo: string,
    	chartName: string
    ): Promise<ArtifactHubPackage> {
    	const url = `https://artifacthub.io/api/v1/packages/helm/${encodeURIComponent(
    		chartRepo
    	)}/${encodeURIComponent(chartName)}`;
    	return (await fetchFromArtifactHub(url)) as ArtifactHubPackage;
    }
  • The parameter schema for the helm-chart-info tool.
    export interface InfoParams {
    	chartRepo: string;
    	chartName: string;
    }

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/hd-deman/artifacthub-mcp'

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