Skip to main content
Glama
resurs.ts2.09 kB
import Cache from "./cache.js" // Функция для загрузки llms.txt (структурированный список ключевых страниц) export const loadLlmsTxt = async () => { if (Cache.has('llmsTxt')) return Cache.get('llmsTxt') as string; try { const response = await fetch('https://primevue.org/llms/llms.txt'); if (!response.ok) { throw new Error(`Failed to fetch llms.txt: ${response.statusText}`); } const text = await response.text(); Cache.set('llmsTxt', text); return text; } catch (error) { console.error('Error loading llms.txt:', error); throw error; } } // Функция для загрузки llms-full.txt (полная документация) export const loadLlmsFullTxt = async () => { if (Cache.has('llmsFullTxt')) return Cache.get('llmsFullTxt') as string; try { const response = await fetch('https://primevue.org/llms/llms-full.txt'); if (!response.ok) { throw new Error(`Failed to fetch llms-full.txt: ${response.statusText}`); } const text = await response.text() Cache.set('llmsFullTxt', text); return text; } catch (error) { console.error('Error loading llms-full.txt:', error); throw error; } } // Функция для загрузки документации компонента в формате Markdown export const loadComponentDoc = async (componentName: string) => { const normalizedName = componentName.toLowerCase(); if (Cache.has(normalizedName)) return Cache.get(normalizedName)!; try { const url = `https://primevue.org/llms/components/${normalizedName}.md`; const response = await fetch(url); if (!response.ok) { throw new Error(`Failed to fetch component ${componentName}: ${response.statusText}`); } const text = await response.text(); Cache.set(normalizedName, text); return text; } catch (error) { console.error(`Error loading component ${componentName}:`, error); throw error; } }

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/vwinterdev/mcp-test'

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