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
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Component documentation link URL, from the componentDocumentLinks property, please ensure the URL is valid |
Implementation Reference
- src/tools/get-component-link.ts:24-52 (handler)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);
- src/tools/base-tool.ts:9-16 (helper)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) ); }