Skip to main content
Glama
Jpisnice
by Jpisnice
parse-presets.ts895 B
/** * Utilities to search and filter presets fetched from tweakcn */ export function filterPresets( presets: Record<string, any>, keywords?: string ): Array<{ id: string; label: string; description?: string }> { const results: Array<{ id: string; label: string; description?: string }> = []; const lower = (s?: string) => (s || "").toLowerCase(); const q = (keywords || "").toLowerCase(); for (const id of Object.keys(presets || {})) { const preset = presets[id] || {}; const label = preset.label || id; const desc = preset.description || preset.label || ""; if (!q) { results.push({ id, label, description: desc }); continue; } if (label.toLowerCase().includes(q) || lower(desc).includes(q) || id.toLowerCase().includes(q)) { results.push({ id, label, description: desc }); } } return results; } export default filterPresets;

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/Jpisnice/shadcn-ui-mcp-server'

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