ನಿಖರ ಘಟಕ ಒಪ್ಪಂದವನ್ನು ಹುಡುಕಿ
ಘಟಕ ಹುಡುಕಿ. ಅದರ ನಿಖರ API ಓದಿ.
ಸಾರ್ವಜನಿಕ ಕ್ಯಾಟಲಾಗ್, ರಚಿತ API ಸೂಚಿ, ವಿಭಜಿತ ದಾಖಲೆಗಳು ಮತ್ತು MCP ಹುಡುಕಾಟವು ಗುಣಲಕ್ಷಣಗಳು, ಘಟನೆಗಳು, ಸ್ಲಾಟ್ಗಳು, ಅವಲಂಬನೆಗಳು ಮತ್ತು ಸ್ಥಳಾಂತರ ಮಾರ್ಗದರ್ಶನ ನೀಡುತ್ತವೆ. ಹೀಗಾಗಿ ಏಜೆಂಟ್ಗಳು ಗುರುತು ಬರೆಯುವ ಮೊದಲು ನಿಖರ ಒಪ್ಪಂದ ನೋಡಬಹುದು.
ಉದಾಹರಣೆ
ಕಂಪೋನೆಂಟ್ ಹುಡುಕಿ, ನಂತರ ಅದರ ನಿಖರವಾದ API ಓದಿ.
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);
}