Skip to main content
Glama

mcp__getComponentLink

Retrieve component documentation data from URLs in the componentDocumentLinks array to generate frontend code based on design components.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesComponent documentation link URL, from the componentDocumentLinks property, please ensure the URL is valid

Implementation Reference

  • The execute method implements the core logic of the mcp__getComponentLink tool: fetches component documentation via HTTP GET from the provided URL and returns it as text content, or an error if failed.
    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), }), }, ], }; } }
  • Zod schema defining the single input parameter 'url' which is the component documentation link.
    schema = z.object({ url: z .string() .describe( "Component documentation link URL, from the componentDocumentLinks property, please ensure the URL is valid" ), });
  • src/index.ts:36-36 (registration)
    Instantiates and registers the GetComponentLinkTool with the MCP server.
    new GetComponentLinkTool().register(server);
  • The register method in the base class that performs the actual MCP server.tool registration using the tool's name, description, schema, and execute function.
    register(server: McpServer) { server.tool( this.name, this.description, this.schema.shape, this.execute.bind(this) ); }

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

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