Skip to main content
Glama
eDramas

MasterGo Magic MCP

by eDramas

mcp__getComponentLink

Retrieves component documentation data from a provided URL to enable frontend code generation 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 of GetComponentLinkTool that performs the HTTP GET request to fetch component documentation from the given URL and returns the content.
      async execute({ url }: z.infer<typeof this.schema>) {
        try {
          const data = await this.httpUtil.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 input parameter: a 'url' string describing 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:42-42 (registration)
    Registration of GetComponentLinkTool in the main entry point, which calls register() on the MCP server.
    new GetComponentLinkTool(httpUtil).register(server);
  • The register method in BaseTool calls server.tool() with the tool's name, description, schema, and execute handler.
    register(server: McpServer) {
      server.tool(
        this.name,
        this.description,
        this.schema.shape,
        this.execute.bind(this)
      );
  • The getDsl method in HttpUtil that returns componentDocumentLinks and includes a rule instructing the LLM to use mcp__getComponentLink to fetch component documentation.
    public async getDsl(fileId: string, layerId: string): Promise<DslResponse> {
      try {
        const params: any = { fileId, layerId };
    
        const response = await this.httpClient.get("/mcp/dsl", { params });
        const result = {
          dsl: response.data,
          componentDocumentLinks: this.handleDslComponentDocumentLinks(
            response.data
          ),
          rules: [
            "token filed must be generated as a variable (colors, shadows, fonts, etc.) and the token field must be displayed in the comment",
            `
              componentDocumentLinks is a list of frontend component documentation links used in the DSL layer, designed to help you understand how to use the components.
              When it exists and is not empty, you need to use mcp__getComponentLink in a for loop to get the URL content of all components in the list, understand how to use the components, and generate code using the components.
              For example: 
                \`\`\`js  
                  const componentDocumentLinks = [
                    'https://example.com/ant/button.mdx',
                    'https://example.com/ant/button.mdx'
                  ]
                  for (const url of componentDocumentLinks) {
                    const componentLink = await mcp__getComponentLink(url);
                    console.log(componentLink);
                  }
                \`\`\`
            `,
Behavior3/5

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

With no annotations, the description must disclose all behavioral traits. It mentions sequential retrieval but does not describe side effects, error handling for invalid URLs, or rate limits. This is adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the usage condition, and contains no unnecessary words. Every sentence serves a purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, no output schema) and lack of annotations, the description adequately covers purpose, usage condition, and parameter source. It could detail return value structure but notes its use for code generation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the parameter description in the schema already explains the URL source and validity. The tool description adds little new semantic value beyond restating the source.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves component documentation data using URLs from the componentDocumentLinks array, distinguishing it from its sibling mcp__getDsl which returns DSL data. The verb 'retrieve' and resource 'component documentation data' are specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly specifies the condition for use: when mcp__getDsl returns a non-empty componentDocumentLinks array. It implies sequential retrieval but does not specify when not to use it or mention alternatives beyond the sibling.

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

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