helm-chart-values
Retrieve the values.yaml file for a specific Helm chart from Artifact Hub to configure and customize Kubernetes deployments.
Instructions
Get the values.yaml file for a specific Helm chart from Artifact Hub
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chartRepo | Yes | The Helm chart repository name | |
| chartName | Yes | The Helm chart name | |
| version | No | The chart version (optional, defaults to latest) |
Implementation Reference
- src/tools/values.ts:19-53 (handler)The handler logic for the 'helm-chart-values' tool, which fetches chart information and then the values.yaml.
async ({ chartRepo, chartName, version }: ValuesParams) => { try { let packageId: string; let chartVersion: string; // First get the chart info const chartInfo = await getChartInfo(chartRepo, chartName); packageId = chartInfo.package_id; // If version is not provided, use the latest version chartVersion = version || chartInfo.version; // Get the values.yaml const valuesYaml = await getChartValues(packageId, chartVersion); return { content: [ { type: "text", text: valuesYaml, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error retrieving values.yaml: ${(error as Error).message}`, }, ], }; } } ); - src/tools/values.ts:7-54 (registration)Registration of the 'helm-chart-values' tool within the MCP server.
export function registerValuesTool(server: McpServer) { return server.tool( "helm-chart-values", "Get the values.yaml file for a specific Helm chart from Artifact Hub", { chartRepo: z.string().describe("The Helm chart repository name"), chartName: z.string().describe("The Helm chart name"), version: z .string() .optional() .describe("The chart version (optional, defaults to latest)"), }, async ({ chartRepo, chartName, version }: ValuesParams) => { try { let packageId: string; let chartVersion: string; // First get the chart info const chartInfo = await getChartInfo(chartRepo, chartName); packageId = chartInfo.package_id; // If version is not provided, use the latest version chartVersion = version || chartInfo.version; // Get the values.yaml const valuesYaml = await getChartValues(packageId, chartVersion); return { content: [ { type: "text", text: valuesYaml, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error retrieving values.yaml: ${(error as Error).message}`, }, ], }; } } ); }