Skip to main content
Glama

list-components

Retrieve available Ant Design UI components to integrate into your codebase. This tool provides the component list needed for building user interfaces.

Instructions

当用户请求一个新的用户界面(UI)使用 Ant Design 组件时使用此工具。 此工具仅返回可用的组件列表。 调用此工具后,你必须编辑或添加文件,以便将代码片段集成到代码库中

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list-components' tool. It loads the list of available Ant Design components using loadComponentsList() and returns a text message containing the JSON-stringified list of components (excluding dirName).
    调用此工具后,你必须编辑或添加文件,以便将代码片段集成到代码库中`, async () => {
        const components = await loadComponentsList();
        return {
          content: [
            {
              type: "text",
              text: `以下是可用的组件:${JSON.stringify(components.map(({ dirName, ...restProps }) => restProps))}`,
            },
          ],
        };
      });
  • Registers the 'list-components' tool on the MCP server, including the tool name, description in Chinese, and the handler function.
    const registryTool = (server: McpServer) => {
      server.tool(
        "list-components", `当用户请求一个新的用户界面(UI)使用 Ant Design 组件时使用此工具。
    此工具仅返回可用的组件列表。
    调用此工具后,你必须编辑或添加文件,以便将代码片段集成到代码库中`, async () => {
        const components = await loadComponentsList();
        return {
          content: [
            {
              type: "text",
              text: `以下是可用的组件:${JSON.stringify(components.map(({ dirName, ...restProps }) => restProps))}`,
            },
          ],
        };
      });
    }
  • Top-level registration function that invokes the listComponents registry function (imported from './list-components') along with other tools on the MCP server.
    export default function registryTools(server: McpServer) {
      [getComponentDocs, listComponentExamples, getComponentChangelog, listComponents].forEach((registryFn) => {
        registryFn(server)
      })
    }
  • Helper function that loads the list of Ant Design components from a cached value or the JSON file at EXTRACTED_COMPONENTS_LIST_PATH, parsing it and caching the result.
    export async function loadComponentsList() {
      try {
        const cacheComponentList = componentCache.get('componentsList')
        if (cacheComponentList) {
          return cacheComponentList
        }
        
        const componentList = await readFile(EXTRACTED_COMPONENTS_LIST_PATH, "utf-8");
    
        const componentListJson = JSON.parse(componentList) as ComponentData[]
        
        componentCache.set('componentsList', componentListJson)
        
        return componentListJson
      } catch (error) {
        console.error(`加载组件列表错误: ${(error as Error).message}`);
        return [];
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool '仅返回可用的组件列表' (returns only the available component list), which implies a read-only operation, but doesn't disclose behavioral traits like whether it requires authentication, has rate limits, or returns structured data. The second sentence about editing files adds confusion as it describes post-call actions, not the tool's behavior itself, leaving gaps in transparency.

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

Conciseness3/5

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

The description is two sentences, but the second sentence ('调用此工具后,你必须编辑或添加文件...') is somewhat redundant and adds unnecessary detail about post-call actions, diluting focus. It's front-loaded with the primary purpose, but could be more concise by omitting the implementation guidance, which doesn't directly help tool selection.

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

Completeness3/5

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

Given no annotations, no output schema, and 0 parameters, the description is moderately complete. It covers the purpose and usage context well, but lacks details on return values (e.g., list format) and behavioral aspects like error handling. For a simple list tool, this is adequate but has clear gaps in transparency and output expectations.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter semantics, but this is appropriate given the lack of parameters. A baseline score of 4 is applied as per rules for 0 parameters, as it doesn't need to compensate for any schema gaps.

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

Purpose4/5

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

The description clearly states the tool's purpose: '仅返回可用的组件列表' (returns only the available component list). It specifies the resource (Ant Design components) and distinguishes it from siblings like get-component-docs or list-component-examples by focusing on listing rather than documentation or examples. However, it doesn't explicitly mention the verb 'list' in the first sentence, slightly reducing specificity.

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

Usage Guidelines5/5

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

The description provides explicit usage guidelines: '当用户请求一个新的用户界面(UI)使用 Ant Design 组件时使用此工具' (use this tool when the user requests a new UI using Ant Design components). It implies an alternative workflow (editing/adding files after calling) and distinguishes from siblings by focusing on initial listing rather than detailed docs or examples, though it doesn't name alternatives directly.

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/zhixiaoqiang/antd-components-mcp'

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