Skip to main content
Glama
AlexW00

ArtifactHub MCP Server

by AlexW00

helm-chart-values-fuzzy-search

Search Helm chart values.yaml files with fuzzy matching to find properties, values, and comments across repositories and versions.

Instructions

Fuzzy search through all properties/values/comments in a Helm chart's values.yaml file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chartRepoYesThe Helm chart repository name
chartNameYesThe Helm chart name
searchQueryYesThe search query for fuzzy matching
versionNoThe chart version (optional, defaults to latest)

Implementation Reference

  • Main handler logic: fetches chart info and values.yaml from ArtifactHub, parses YAML with comments, collects all properties recursively, uses Fuse.js for fuzzy search on name/path/comment/value, formats and returns markdown results or error.
    async ({
    	chartRepo,
    	chartName,
    	searchQuery,
    	version,
    }: FuzzySearchParams) => {
    	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);
    
    		// Parse YAML to get the value
    		const parsedYaml = parse(valuesYaml);
    		const doc = parseDocument(valuesYaml);
    
    		// Collect all properties recursively
    		const allProperties = collectPropertiesRecursive(parsedYaml, "", doc);
    
    		// Set up Fuse.js for fuzzy searching
    		const fuse = new Fuse(allProperties, {
    			keys: ["propertyName", "propertyPath", "comment", "value"],
    			includeScore: true,
    			threshold: 0.4,
    		});
    
    		// Perform the fuzzy search
    		const searchResults = fuse.search(searchQuery);
    
    		// Format the results
    		let responseText = "";
    		if (searchResults.length > 0) {
    			responseText = `# Found ${searchResults.length} matching properties:\n\n`;
    
    			searchResults.forEach((result, index) => {
    				const property = result.item;
    				responseText += `## ${index + 1}. ${property.propertyPath}\n`;
    
    				if (property.comment) {
    					responseText += `Comment: ${property.comment.trim()}\n`;
    				}
    
    				if (property.value !== undefined) {
    					responseText += `Value: ${
    						typeof property.value === "object"
    							? JSON.stringify(property.value, null, 2)
    							: String(property.value)
    					}\n`;
    				} else {
    					responseText += "Value: [object]\n";
    				}
    
    				responseText += "\n";
    			});
    		} else {
    			responseText = `No properties matching "${searchQuery}" found.`;
    		}
    
    		return {
    			content: [
    				{
    					type: "text",
    					text: responseText,
    				},
    			],
    		};
    	} catch (error) {
    		return {
    			content: [
    				{
    					type: "text",
    					text: `Error performing fuzzy search: ${
    						(error as Error).message
    					}`,
    				},
    			],
    		};
    	}
    }
  • Zod schema for tool input parameters: chartRepo, chartName, searchQuery, optional version.
    {
    	chartRepo: z.string().describe("The Helm chart repository name"),
    	chartName: z.string().describe("The Helm chart name"),
    	searchQuery: z.string().describe("The search query for fuzzy matching"),
    	version: z
    		.string()
    		.optional()
    		.describe("The chart version (optional, defaults to latest)"),
    },
  • src/index.ts:19-19 (registration)
    Top-level registration call that invokes the tool registration function on the MCP server instance.
    registerFuzzySearchValuesTool(server);
  • Recursive helper to traverse YAML object, extract property paths, values (leaf only), and associated comments using yaml parseDocument nodes.
    function collectPropertiesRecursive(
    	obj: any,
    	currentPath = "",
    	doc: any,
    	result: ValueProperty[] = []
    ): ValueProperty[] {
    	if (obj === null || typeof obj !== "object") {
    		return result;
    	}
    
    	for (const key in obj) {
    		const value = obj[key];
    		const newPath = currentPath ? `${currentPath}.${key}` : key;
    
    		// Try to extract comment for this property
    		let comment: string | undefined = undefined;
    		try {
    			// Navigate through the document to find comments
    			let currentNode = doc.contents;
    			for (const part of newPath.split(".")) {
    				if (
    					currentNode &&
    					typeof currentNode === "object" &&
    					"get" in currentNode
    				) {
    					const node = currentNode.get(part);
    					if (node) {
    						if (node.commentBefore) {
    							comment = node.commentBefore;
    						}
    						currentNode = node;
    					} else {
    						break;
    					}
    				} else {
    					break;
    				}
    			}
    		} catch (e) {
    			// If we can't get comments, just ignore and continue
    		}
    
    		// Add property to result
    		const property: ValueProperty = {
    			propertyName: key,
    			propertyPath: newPath,
    			comment,
    		};
    
    		// Only add value if it's not an object
    		if (value === null || typeof value !== "object") {
    			property.value = value;
    		}
    
    		result.push(property);
    
    		// Recursively process nested objects
    		if (value !== null && typeof value === "object") {
    			collectPropertiesRecursive(value, newPath, doc, result);
    		}
    	}
    
    	return result;
    }
  • Tool registration function defining the tool name, description, schema, and handler using MCP server.tool method.
    export function registerFuzzySearchValuesTool(server: McpServer) {
    	return server.tool(
    		"helm-chart-values-fuzzy-search",
    		"Fuzzy search through all properties/values/comments in a Helm chart's values.yaml file",
    		{
    			chartRepo: z.string().describe("The Helm chart repository name"),
    			chartName: z.string().describe("The Helm chart name"),
    			searchQuery: z.string().describe("The search query for fuzzy matching"),
    			version: z
    				.string()
    				.optional()
    				.describe("The chart version (optional, defaults to latest)"),
    		},
    		async ({
    			chartRepo,
    			chartName,
    			searchQuery,
    			version,
    		}: FuzzySearchParams) => {
    			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);
    
    				// Parse YAML to get the value
    				const parsedYaml = parse(valuesYaml);
    				const doc = parseDocument(valuesYaml);
    
    				// Collect all properties recursively
    				const allProperties = collectPropertiesRecursive(parsedYaml, "", doc);
    
    				// Set up Fuse.js for fuzzy searching
    				const fuse = new Fuse(allProperties, {
    					keys: ["propertyName", "propertyPath", "comment", "value"],
    					includeScore: true,
    					threshold: 0.4,
    				});
    
    				// Perform the fuzzy search
    				const searchResults = fuse.search(searchQuery);
    
    				// Format the results
    				let responseText = "";
    				if (searchResults.length > 0) {
    					responseText = `# Found ${searchResults.length} matching properties:\n\n`;
    
    					searchResults.forEach((result, index) => {
    						const property = result.item;
    						responseText += `## ${index + 1}. ${property.propertyPath}\n`;
    
    						if (property.comment) {
    							responseText += `Comment: ${property.comment.trim()}\n`;
    						}
    
    						if (property.value !== undefined) {
    							responseText += `Value: ${
    								typeof property.value === "object"
    									? JSON.stringify(property.value, null, 2)
    									: String(property.value)
    							}\n`;
    						} else {
    							responseText += "Value: [object]\n";
    						}
    
    						responseText += "\n";
    					});
    				} else {
    					responseText = `No properties matching "${searchQuery}" found.`;
    				}
    
    				return {
    					content: [
    						{
    							type: "text",
    							text: responseText,
    						},
    					],
    				};
    			} catch (error) {
    				return {
    					content: [
    						{
    							type: "text",
    							text: `Error performing fuzzy search: ${
    								(error as Error).message
    							}`,
    						},
    					],
    				};
    			}
    		}
    	);
    }
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 the tool performs a 'fuzzy search' but does not explain what that entails (e.g., partial matches, case sensitivity, scoring). It lacks details on permissions, rate limits, or what the output looks like (e.g., list of matches with context). This is inadequate for a search tool with zero annotation coverage.

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, efficient sentence that front-loads the core purpose ('fuzzy search') and specifies the scope ('all properties/values/comments in a Helm chart's values.yaml file'). There is no wasted verbiage, making it highly concise and well-structured.

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?

Given the complexity of a fuzzy search operation, no annotations, and no output schema, the description is incomplete. It does not explain the search behavior, result format, or error handling. While the schema covers parameters well, the overall context for using the tool effectively is lacking, especially for an agent needing to interpret results.

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?

Schema description coverage is 100%, with clear descriptions for all parameters (chartRepo, chartName, searchQuery, version). The description adds no additional meaning beyond the schema, such as examples of search queries or how 'fuzzy' matching works. The baseline score of 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('fuzzy search') and the target resource ('all properties/values/comments in a Helm chart's values.yaml file'), making the purpose specific and unambiguous. It distinguishes itself from siblings like 'helm-chart-values' (likely a direct fetch) and 'helm-chart-templates-fuzzy-search' (targets templates instead of values).

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?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, such as needing the chart to be available in a repository, or compare it to siblings like 'helm-chart-values' (which might retrieve the full values file) or 'helm-chart-templates-fuzzy-search' (which searches templates). Usage context is implied but not explicit.

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

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