search_utilities
Search the CustomClaw registry of vetted utilities using fuzzy keyword matching across names, descriptions, and categories. Returns top 25 relevant results.
Instructions
Fuzzy-search the CustomClaw registry by keyword. Matches across slug, name, tagline, description, and category. Returns the top 25 matches sorted by relevance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Keyword(s) to search for, e.g. "token optimiser" or "stripe". |
Implementation Reference
- index.js:201-217 (registration)Tool registration for 'search_utilities' defining name, description, and inputSchema.
{ name: 'search_utilities', description: 'Fuzzy-search the CustomClaw registry by keyword. Matches across slug, name, tagline, description, and category. ' + 'Returns the top 25 matches sorted by relevance.', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Keyword(s) to search for, e.g. "token optimiser" or "stripe".', }, }, required: ['query'], additionalProperties: false, }, }, - index.js:276-286 (handler)Handler case in CallToolRequestSchema that executes search_utilities logic: validates query, fetches catalog, calls fuzzySearch, and returns matches.
case 'search_utilities': { if (!args.query || typeof args.query !== 'string') { return textResult('Error: query is required (string).'); } const catalog = await fetchCatalog(); const matches = fuzzySearch(catalog, args.query); if (matches.length === 0) { return textResult(`No matches for "${args.query}". Try list_utilities to browse the full catalog.`); } return jsonResult({ query: args.query, count: matches.length, results: matches }); } - index.js:85-92 (helper)fuzzySearch helper: scores all entries against the query, filters by score > 0, sorts descending by score, returns top 25 matches.
function fuzzySearch(catalog, query) { return allEntries(catalog) .map((e) => ({ entry: e, score: scoreMatch(e, query) })) .filter((x) => x.score > 0) .sort((a, b) => b.score - a.score) .slice(0, 25) .map((x) => x.entry); } - index.js:58-83 (helper)scoreMatch helper: scores an entry against a query string by comparing slug, name, tagline, description, and category fields with weighted fuzzy matching (exact match, includes, token match).
function scoreMatch(entry, q) { const query = q.toLowerCase().trim(); if (!query) return 0; const fields = [ [entry.slug || '', 4], [entry.name || '', 3], [entry.tagline || '', 2], [entry.description || '', 1], [entry.category || '', 1], ]; let score = 0; for (const [val, weight] of fields) { const v = String(val).toLowerCase(); if (!v) continue; if (v === query) score += weight * 10; else if (v.includes(query)) score += weight * 3; else { // token match const tokens = query.split(/\s+/).filter(Boolean); for (const t of tokens) { if (v.includes(t)) score += weight; } } } return score; }