Skip to main content
Glama
ceorkm

ReactBits MCP Server

by ceorkm

list_components

Discover and filter ReactBits animated components by category or styling method to find suitable UI elements for React projects.

Instructions

List all available ReactBits components with optional filtering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter by category (e.g., animations, backgrounds, buttons)
styleNoFilter by styling method
limitNoMaximum number of components to return

Implementation Reference

  • Core handler function that implements the list_components tool logic: iterates over component registry categories, filters by options, augments components with health status and dependencies, applies style and limit filters.
    async listComponents(options: {
      category?: string;
      style?: 'css' | 'tailwind' | 'default';
      limit?: number;
    } = {}): Promise<ReactBitsComponent[]> {
      let components: ReactBitsComponent[] = [];
    
      // Use the auto-generated registry
      for (const category of componentRegistry.categories) {
        if (!options.category || category.slug === options.category) {
          const categoryHealth = (componentHealth.componentHealth as any)[category.slug] || {};
          
          components.push(...category.components.map(comp => {
            const componentStatus = categoryHealth.components?.[comp.slug] || 'unknown';
            const dependencies = this.getComponentDependencies(comp.slug);
            
            return {
              ...comp,
              description: `A ${comp.name} component from ReactBits`,
              quality: categoryHealth.quality,
              status: componentStatus,
              dependencies
            };
          }));
        }
      }
    
      // Filter by style if specified
      if (options.style) {
        components = components.filter(comp => {
          if (options.style === 'css') return comp.hasCSS;
          if (options.style === 'tailwind') return comp.hasTailwind;
          return true;
        });
      }
    
      // Apply limit
      if (options.limit && options.limit > 0) {
        components = components.slice(0, options.limit);
      }
    
      return components;
    }
  • MCP server request handler for 'list_components' tool: parses input arguments into ComponentListOptions and delegates execution to ReactBitsService.listComponents, returning JSON stringified result.
    case 'list_components': {
      const options: ComponentListOptions = {
        category: args?.category as string,
        style: args?.style as any,
        limit: args?.limit as number,
      };
      const components = await reactBitsService.listComponents(options);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(components, null, 2),
          },
        ],
      };
    }
  • src/index.ts:28-49 (registration)
    Tool registration in MCP server: defines 'list_components' name, description, and input schema for listing components with optional filters.
    {
      name: 'list_components',
      description: 'List all available ReactBits components with optional filtering',
      inputSchema: {
        type: 'object',
        properties: {
          category: {
            type: 'string',
            description: 'Filter by category (e.g., animations, backgrounds, buttons)',
          },
          style: {
            type: 'string',
            enum: ['css', 'tailwind', 'default'],
            description: 'Filter by styling method',
          },
          limit: {
            type: 'number',
            description: 'Maximum number of components to return',
          },
        },
      },
    },
  • TypeScript interface defining the options structure for listComponents, matching the tool input schema.
    export interface ComponentListOptions {
      category?: string;
      style?: ComponentStyle;
      limit?: number;
    }
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 mentions 'optional filtering' but doesn't disclose behavioral traits like whether this is a read-only operation, how results are ordered, if pagination is supported, or what the output format looks like. For a listing tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 ('List all available ReactBits components') and adds essential qualification ('with optional filtering'). There is zero waste, and every word earns its place, making it highly 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 moderate complexity (3 optional parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on behavior, output format, or usage context. Without annotations or output schema, more information would be helpful for an agent to use it effectively, but it meets the bare minimum for a listing tool.

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 description coverage is 100%, so the schema already documents all three parameters (category, style, limit) with descriptions and an enum for style. The description adds no additional parameter semantics beyond what's in the schema, such as explaining how filtering works or default behaviors. Baseline 3 is appropriate when the schema does the heavy lifting.

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 verb ('List') and resource ('ReactBits components'), making the purpose unambiguous. It distinguishes from siblings like 'get_component' (singular) and 'search_components' (likely more flexible filtering) by focusing on listing all with optional filtering. However, it doesn't explicitly contrast with 'list_categories', which might be a related but distinct operation.

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

Usage Guidelines3/5

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

The description implies usage for listing components with optional filtering, but doesn't explicitly state when to use this versus alternatives like 'search_components' or 'get_component'. It provides some context through the optional filtering mention, but lacks clear guidance on scenarios where this tool is preferred over siblings.

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/ceorkm/reactbits-mcp-server'

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