get-blocks-metadata
Retrieve metadata of FlyonUI blocks from a specified URL. This tool supports developers in accessing detailed information for UI components, aiding in the creation and refactoring process within popular frameworks.
Instructions
Fetch the metadata of a block from a given URL. Use this tool to retrieve the block metadata. This will provide the metadata of all the FlyonUI blocks available for use.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:116-138 (handler)Handler function that fetches block metadata from the API endpoint `/instructions?path=block_metadata.json` and returns it formatted as JSON text content.async () => { try { const url = `/instructions?path=block_metadata.json`; const response = await apiClient.get(url); if (response.status !== 200) { throw new Error(`Failed to fetch block metadata: ${response.status}`); } return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), } ], }; } catch (error) { console.error("Error fetching block metadata:", error); throw new Error("Failed to fetch block metadata"); } }
- src/index.ts:110-139 (registration)Registration of the 'get-blocks-metadata' tool with server.registerTool, providing title, description, and an inline anonymous handler function that has no input parameters.server.registerTool( "get-blocks-metadata", { title: "Get Block Metadata", description: "Fetch the metadata of a block from a given URL. Use this tool to retrieve the block metadata. This will provide the metadata of all the FlyonUI blocks available for use.", }, async () => { try { const url = `/instructions?path=block_metadata.json`; const response = await apiClient.get(url); if (response.status !== 200) { throw new Error(`Failed to fetch block metadata: ${response.status}`); } return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), } ], }; } catch (error) { console.error("Error fetching block metadata:", error); throw new Error("Failed to fetch block metadata"); } } );