get-block-meta-content
Retrieve block metadata content from the FlyonUI MCP server to access UI component information for development workflows.
Instructions
Fetch the content of the block metadata from the FlyonUI MCP server. Use this tool to retrieve the block metadata content.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endpoint | Yes |
Implementation Reference
- src/index.ts:149-172 (handler)The handler function that implements the 'get-block-meta-content' tool. It takes an 'endpoint' parameter, appends '?type=mcp' to it, fetches data using apiClient.get, and returns the JSON response formatted as text content. Errors are caught and rethrown with specific messages.async ({ endpoint }) => { try { const url = endpoint + "?type=mcp"; const response = await apiClient.get(url); if (response.status !== 200) { throw new Error(`Failed to fetch block meta content: ${response.status}`); } return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), } ], }; } catch (error) { console.error("Error fetching block meta content:", error); throw new Error("Failed to fetch block meta content"); } }
- src/index.ts:147-147 (schema)The input schema for the tool, defining a single required string parameter 'endpoint' using Zod validation.inputSchema: { endpoint: z.string() },
- src/index.ts:142-173 (registration)The registration of the 'get-block-meta-content' tool using server.registerTool, specifying the tool name, metadata (title, description), input schema, and the inline handler function.server.registerTool( "get-block-meta-content", { title: "Get Block Meta Content", description: "Fetch the content of the block metadata from the FlyonUI MCP server. Use this tool to retrieve the block metadata content.", inputSchema: { endpoint: z.string() }, }, async ({ endpoint }) => { try { const url = endpoint + "?type=mcp"; const response = await apiClient.get(url); if (response.status !== 200) { throw new Error(`Failed to fetch block meta content: ${response.status}`); } return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), } ], }; } catch (error) { console.error("Error fetching block meta content:", error); throw new Error("Failed to fetch block meta content"); } } );
- src/index.ts:5-5 (helper)Import of the apiClient helper used in the tool handler for making HTTP GET requests to fetch block meta content.import { apiClient } from "./utils/http-client.js";
- src/utils/http-client.ts:60-66 (helper)The apiClient object definition, which provides the generic HTTP client methods (including get) used by the tool handler to communicate with the FlyonUI API.export const apiClient: HttpClient = { get: createMethod("GET"), post: createMethod("POST"), put: createMethod("PUT"), delete: createMethod("DELETE"), patch: createMethod("PATCH"), };