Thola isivumelwano esiqondile sengxenye
Thola ingxenye. Funda i-API yayo ngqo.
Ikhathalogi yomphakathi, inkomba ye-API ehlelekile, izinkomba ezihlukene nosesho lwe-MCP kuveza izici zezingxenye, imicimbi, ama-slot, okunye okudingekayo neziqondiso zokufuduka. Lokhu kuvumela ama-ejenti okubhala ikhodi ukuthi ahlole isivumelwano esiqondile ngaphambi kokubhala i-markup.
Isibonelo
Sesha ingxenye, bese ufunda i-API yayo eqondile.
const origin = 'https://www.lyra-ui.com/api/v1/components';
const search = await fetch(origin + '/search?q=combobox');
if (!search.ok) throw new Error('Component search failed');
const { matches } = await search.json();
const tag = matches[0]?.tag;
if (tag) {
const response = await fetch(origin + '/' + encodeURIComponent(tag));
if (!response.ok) throw new Error('Component reference failed');
const reference = await response.json();
console.log(reference.markdown);
}