Skip to main content
Glama

Get Block Data

get-block-content

Fetch the content of a code block from an authenticated URL by providing endpoint and block type. Use this to retrieve UI component code.

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 takes endpoint and type parameters, constructs a URL, makes a GET request via apiClient, and returns the block content as JSON.
    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 for 'get-block-content' using zod: endpoint (string) and type (string) parameters.
        inputSchema: { endpoint: z.string(), type: z.string() }
    },
  • src/index.ts:176-206 (registration)
    Registration of the 'get-block-content' tool via server.registerTool with title, description, inputSchema, and handler.
    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");
            }
        }
    );
Behavior2/5

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

No annotations are provided, and the description only implies a read operation ('Fetch'). It mentions 'authenticated URL' but does not disclose other behavioral traits such as side effects, rate limits, or error conditions.

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 consists of two concise sentences that efficiently convey the core action and usage intent. Minor redundancy ('from a given URL' and 'from the authenticated URL') does not significantly detract.

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?

With no output schema, no annotations, and two undocumented parameters, the description fails to explain the output format, the meaning of 'type', or what constitutes a 'block'. Siblings exist but are not differentiated.

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 has 0% description coverage for parameters. The description only hints that 'endpoint' is a URL but does not explain the 'type' parameter or provide format details beyond what the schema names show.

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 it fetches block content from a URL and specifies 'code block content', which differentiates it from siblings like 'get-block-meta-content' that likely fetch metadata. However, it does not explicitly contrast with siblings.

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?

The description says 'Use this tool to retrieve the code block content from the authenticated URL' but provides no guidance on when not to use it or how it compares to alternative sibling tools.

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