Skip to main content
Glama

Get Block Data

get-block-content

Fetch code block content from authenticated URLs to retrieve UI component implementations for development workflows.

Instructions

Fetch the content of a block from a given URL. Use this tool to retrieve the code block content from the authenticated URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointYes
typeYes

Implementation Reference

  • The handler function for the 'get-block-content' tool. It constructs a URL by appending the 'type' query parameter to the endpoint, fetches the data using apiClient.get, and returns the response content formatted as MCP text content.
    async ({ endpoint, type }) => {
        try {
            const url = endpoint + "?type=" + type;
            const response = await apiClient.get(url);
    
            if (response.status !== 200) {
                throw new Error(`Failed to fetch block data: ${response.status}`);
            }
    
            return {
                content: [
                    {
                        type: "text",
                        text: JSON.stringify(response.data, null, 2),
                    }
                ],
            };
        }
        catch (error) {
            console.error("Error fetching block data:", error);
            throw new Error("Failed to fetch block data");
        }
    }
  • Input schema defining required parameters 'endpoint' (string) and 'type' (string) using Zod.
    inputSchema: { endpoint: z.string(), type: z.string() }
  • src/index.ts:176-206 (registration)
    Registers the 'get-block-content' tool with the MCP server, providing name, metadata (title, description, inputSchema), and the handler function.
    server.registerTool(
        "get-block-content",
        {
            title: "Get Block Data",
            description: "Fetch the content of a block from a given URL. Use this tool to retrieve the code block content from the authenticated URL.",
            inputSchema: { endpoint: z.string(), type: z.string() }
        },
        async ({ endpoint, type }) => {
            try {
                const url = endpoint + "?type=" + type;
                const response = await apiClient.get(url);
    
                if (response.status !== 200) {
                    throw new Error(`Failed to fetch block data: ${response.status}`);
                }
    
                return {
                    content: [
                        {
                            type: "text",
                            text: JSON.stringify(response.data, null, 2),
                        }
                    ],
                };
            }
            catch (error) {
                console.error("Error fetching block data:", error);
                throw new Error("Failed to fetch block data");
            }
        }
    );
  • Definition of the apiClient used in the handler. It provides HTTP methods including 'get' which performs authenticated fetch requests to the FlyonUI API base URL.
    export const apiClient: HttpClient = {
        get: createMethod("GET"),
        post: createMethod("POST"),
        put: createMethod("PUT"),
        delete: createMethod("DELETE"),
        patch: createMethod("PATCH"),
    };
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'authenticated URL', hinting at authentication needs, but doesn't specify required permissions, rate limits, error handling, or what 'fetch' entails (e.g., read-only operation, potential side effects). For a tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is concise with two sentences that are front-loaded and to the point, avoiding unnecessary details. However, it could be slightly more structured by explicitly separating purpose from usage, but overall, it's efficient with zero waste.

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 the complexity (2 required parameters, no annotations, no output schema), the description is incomplete. It lacks details on authentication specifics, parameter usage, return values, and error cases. While it hints at authentication, it doesn't provide enough context for an AI agent to reliably invoke the tool without additional information.

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

Parameters2/5

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

The schema description coverage is 0%, so the description must compensate for the undocumented parameters. It only vaguely references 'URL' and 'code block content', which might relate to 'endpoint' and 'type', but doesn't explain what these parameters mean, their expected formats, or how they interact. This adds minimal value beyond the schema, failing to adequately cover the parameter semantics.

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

Purpose4/5

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

The description clearly states the tool's purpose with a specific verb ('fetch') and resource ('content of a block from a given URL'), and it distinguishes the tool by specifying it retrieves 'code block content' from an 'authenticated URL'. However, it doesn't explicitly differentiate from sibling tools like 'get-block-meta-content' or 'get-blocks-metadata', which likely handle metadata rather than content, so it's not a perfect 5.

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

Usage Guidelines3/5

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

The description provides some usage context by stating 'Use this tool to retrieve the code block content from the authenticated URL', which implies when to use it (for fetching code block content from authenticated URLs). However, it doesn't offer explicit guidance on when not to use it or name alternatives among the sibling tools, leaving room for ambiguity in tool selection.

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