Skip to main content
Glama

MasterGo Magic MCP

Official
get-component-link.ts1.55 kB
import { z } from "zod"; import { BaseTool } from "./base-tool"; import { httpUtilInstance } from "../utils/api"; const COMPONENT_LINK_TOOL_NAME = "mcp__getComponentLink"; const COMPONENT_LINK_TOOL_DESCRIPTION = `When the data returned by mcp__getDsl contains a non-empty componentDocumentLinks array, this tool is used to sequentially retrieve URLs from the componentDocumentLinks array and then obtain component documentation data. The returned document data is used for you to generate frontend code based on components.`; export class GetComponentLinkTool extends BaseTool { name = COMPONENT_LINK_TOOL_NAME; description = COMPONENT_LINK_TOOL_DESCRIPTION; constructor() { super(); } schema = z.object({ url: z .string() .describe( "Component documentation link URL, from the componentDocumentLinks property, please ensure the URL is valid" ), }); async execute({ url }: z.infer<typeof this.schema>) { try { const data = await httpUtilInstance.request({ method: "GET", url, }); return { content: [ { type: "text" as const, text: `${data}`, }, ], }; } catch (error) { return { content: [ { type: "text" as const, text: JSON.stringify({ error: "Failed to get component documentation", message: error instanceof Error ? error.message : String(error), }), }, ], }; } } }

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/mastergo-design/mastergo-magic-mcp'

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