Skip to main content
Glama

Get Block Metadata

get-blocks-metadata

Retrieve metadata for all FlyonUI blocks. Provides block details, properties, and structure for component discovery and integration in your UI projects.

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:109-139 (registration)
    Registration of the 'get-blocks-metadata' tool. It defines the tool name, description, and the async handler function that fetches block metadata from the FlyonUI API endpoint `/instructions?path=block_metadata.json`.
    // A tool to get the metadata of a block from a given URL.
    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");
            }
        }
    );
  • The handler function for 'get-blocks-metadata'. It fetches block metadata JSON from the FlyonUI MCP API and returns it as 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");
        }
    }
  • HTTP client utility used by the tool handler to make GET requests to the FlyonUI API at https://flyonui.com/api/mcp.
    import { config } from "./config.js";
    
    const API_KEY =
        config.apiKey || process.env.API_KEY;
    
    export const BASE_URL = "https://flyonui.com/api/mcp";
    
    type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
    
    interface HttpClient {
        get<T>(
            endpoint: string,
            options?: RequestInit
        ): Promise<{ status: number; data: T }>;
        post<T>(
            endpoint: string,
            data?: unknown,
            options?: RequestInit
        ): Promise<{ status: number; data: T }>;
        put<T>(
            endpoint: string,
            data?: unknown,
            options?: RequestInit
        ): Promise<{ status: number; data: T }>;
        delete<T>(
            endpoint: string,
            data?: unknown,
            options?: RequestInit
        ): Promise<{ status: number; data: T }>;
        patch<T>(
            endpoint: string,
            data?: unknown,
            options?: RequestInit
        ): Promise<{ status: number; data: T }>;
    }
    
    const createMethod = (method: HttpMethod) => {
        return async <T>(
            endpoint: string,
            data?: unknown,
            options: RequestInit = {}
        ) => {
            const headers: HeadersInit = {
                "Content-Type": "application/json",
                ...(API_KEY ? { "x-license-key": API_KEY } : {}),
                ...options.headers,
            };
    
            const response = await fetch(`${BASE_URL}${endpoint}`, {
                ...options,
                method,
                headers,
                ...(data ? { body: JSON.stringify(data) } : {}),
            });
    
            return { status: response.status, data: (await response.json()) as T };
        };
    };
    
    export const apiClient: HttpClient = {
        get: createMethod("GET"),
        post: createMethod("POST"),
        put: createMethod("PUT"),
        delete: createMethod("DELETE"),
        patch: createMethod("PATCH"),
    };
  • Schema/title description for the tool. This tool has no input parameters; it has a title 'Get Block Metadata' and a description explaining it fetches metadata of all available FlyonUI blocks.
    {
        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.",
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description should fully disclose behavior. It claims to fetch metadata but does not state whether it is read-only, if it requires a URL (contradicts schema), or what the output format is. The mention of 'all blocks' versus 'from a given URL' is unclear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short but redundant: 'Fetch the metadata' and 'retrieve the block metadata' say the same thing. The inconsistency between URL and all blocks adds confusion, wasting the brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no parameters and no output schema, the description should at least clarify what metadata is returned (e.g., list of properties) and resolve the URL contradiction. It fails to provide a complete understanding of the tool's behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters, but the description incorrectly implies a URL parameter ('from a given URL'), misleading the agent. Since there are no parameters, the description should confirm that no input is needed, but instead it suggests an undefined parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Fetch the metadata of a block from a given URL' but the input schema has no URL parameter, creating a contradiction. It also conflates retrieving a single block's metadata with 'all the FlyonUI blocks', causing ambiguity. No differentiation from sibling tools like get-block-content or get-block-meta-content.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus siblings. The description only says 'Use this tool to retrieve block metadata' but does not explain why one would choose it over get-block-content or get-block-meta-content.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/themeselection/flyonui-mcp'

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