Skip to main content
Glama
totodev999

shadcn-ui MCP Server

by totodev999

list_shadcn_components

Retrieve a comprehensive list of all available shadcn/ui components to explore and reference for UI development projects.

Instructions

Get a list of all available shadcn/ui components

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for 'list_shadcn_components' tool. Scrapes shadcn/ui docs/components page to extract list of components using cheerio, caches the result, and returns as JSON text content.
    private async handleListComponents() {
      try {
        if (!this.componentsListCache) {
          // Fetch the list of components
          const response = await this.axiosInstance.get(
            `${this.SHADCN_DOCS_URL}/docs/components`
          );
          const $ = cheerio.load(response.data);
    
          const components: ComponentInfo[] = [];
    
          // Extract component links
          $('a').each((_, element) => {
            const link = $(element);
            const url = link.attr('href');
    
            if (url && url.startsWith('/docs/components/')) {
              const name = url.split('/').pop() || '';
    
              components.push({
                name,
                description: '', // Will be populated when fetching details
                url: `${this.SHADCN_DOCS_URL}${url}`,
              });
            }
          });
    
          this.componentsListCache = components;
        }
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(this.componentsListCache, null, 2),
            },
          ],
        };
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new McpError(
            ErrorCode.InternalError,
            `Failed to fetch shadcn/ui components: ${error.message}`
          );
        }
        throw error;
      }
    }
  • src/index.ts:108-116 (registration)
    Registration of the 'list_shadcn_components' tool in the ListToolsRequestSchema handler, including name, description, and empty input schema.
    {
      name: 'list_shadcn_components',
      description: 'Get a list of all available shadcn/ui components',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • Input schema for the 'list_shadcn_components' tool: empty object with no properties or requirements.
    inputSchema: {
      type: 'object',
      properties: {},
      required: [],
    },
  • Dispatch case in CallToolRequestSchema handler that routes to the list_shadcn_components implementation.
    case 'list_shadcn_components':
      return await this.handleListComponents();
    case 'get_component_details':
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the tool 'gets a list' but doesn't describe return format, pagination, rate limits, or error handling. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves beyond the basic action.

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 a single, efficient sentence that front-loads the core purpose without any wasted words. Every part of the sentence ('Get a list of all available shadcn/ui components') directly contributes to understanding the tool's function, making it optimally concise and well-structured.

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 the tool's low complexity (0 parameters, no output schema), the description is adequate but has clear gaps. It covers the basic purpose but lacks behavioral details like return format or usage guidelines relative to siblings. Without annotations or output schema, more context on what the list contains or how to interpret results would improve completeness.

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 appropriately doesn't mention parameters, and the baseline for 0 parameters is 4, as it avoids unnecessary details while matching the schema's simplicity.

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 action ('Get a list') and target resource ('all available shadcn/ui components'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'search_components' or 'get_component_details', which prevents a perfect score, but the verb+resource combination is specific and unambiguous.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'search_components' or 'get_component_details'. The description implies it retrieves all components without filtering, but this is not stated explicitly, leaving the agent to infer usage context without clear direction.

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/totodev999/shadcn-ui-mcp-server_clone'

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