Skip to main content
Glama

get-block-content

Retrieve code block content from authenticated URLs using this tool. Designed for developers to fetch block data efficiently within the FlyonUI MCP Server environment.

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

NameRequiredDescriptionDefault
endpointYes
typeYes

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "endpoint": { "type": "string" }, "type": { "type": "string" } }, "required": [ "endpoint", "type" ], "type": "object" }

Implementation Reference

  • src/index.ts:176-206 (registration)
    Registration of the 'get-block-content' tool, including schema, description, and inline 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"); } } );
  • The handler function that executes the tool logic: constructs URL with endpoint and type, fetches data using apiClient, returns formatted JSON text content or throws error.
    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"); } }
  • Tool metadata including title, description, and input schema defining 'endpoint' and 'type' parameters using Zod.
    { 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() } },

Other Tools

Related 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