Skip to main content
Glama
ceorkm

ReactBits MCP Server

by ceorkm

search_components

Search the ReactBits collection of 135+ animated React components by name, description, or category to find the right component for your project.

Instructions

Search for ReactBits components by name or description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
categoryNoFilter by category
limitNoMaximum number of results

Implementation Reference

  • Tool definition and input schema for 'search_components'. Defines the tool name, description, and inputSchema with properties: query (required), category (optional), and limit (optional).
    {
      name: 'search_components',
      description: 'Search for ReactBits components by name or description',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query',
          },
          category: {
            type: 'string',
            description: 'Filter by category',
          },
          limit: {
            type: 'number',
            description: 'Maximum number of results',
          },
        },
        required: ['query'],
      },
    },
  • src/index.ts:27-113 (registration)
    The tool is registered in the `tools` array (line 69-90) and served via the ListToolsRequestSchema handler (line 116-118).
    const tools: Tool[] = [
      {
        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',
            },
          },
        },
      },
      {
        name: 'get_component',
        description: 'Get the source code for a specific ReactBits component',
        inputSchema: {
          type: 'object',
          properties: {
            name: {
              type: 'string',
              description: 'Name of the component (e.g., "splash-cursor", "pixel-card")',
            },
            style: {
              type: 'string',
              enum: ['css', 'tailwind', 'default'],
              description: 'Preferred styling method (defaults to available)',
            },
          },
          required: ['name'],
        },
      },
      {
        name: 'search_components',
        description: 'Search for ReactBits components by name or description',
        inputSchema: {
          type: 'object',
          properties: {
            query: {
              type: 'string',
              description: 'Search query',
            },
            category: {
              type: 'string',
              description: 'Filter by category',
            },
            limit: {
              type: 'number',
              description: 'Maximum number of results',
            },
          },
          required: ['query'],
        },
      },
      {
        name: 'get_component_demo',
        description: 'Get usage example and demo code for a ReactBits component',
        inputSchema: {
          type: 'object',
          properties: {
            name: {
              type: 'string',
              description: 'Name of the component',
            },
          },
          required: ['name'],
        },
      },
      {
        name: 'list_categories',
        description: 'List all available component categories',
        inputSchema: {
          type: 'object',
          properties: {},
        },
      },
    ];
  • Handler case in CallToolRequestSchema for 'search_components'. Extracts searchOptions from args (using ComponentSearchOptions type), validates query is required, then calls reactBitsService.searchComponents() and returns results as JSON.
    case 'search_components': {
      const searchOptions: ComponentSearchOptions = {
        query: args?.query as string,
        category: args?.category as string,
        limit: args?.limit as number,
      };
    
      if (!searchOptions.query) {
        throw new Error('Search query is required');
      }
    
      const results = await reactBitsService.searchComponents(searchOptions);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(results, null, 2),
          },
        ],
      };
    }
  • Core business logic: ReactBitsService.searchComponents(). Filters components by query (matching name, slug, description, or category), then applies optional limit. Returns filtered ReactBitsComponent[].
    async searchComponents(options: {
      query: string;
      category?: string;
      limit?: number;
    }): Promise<ReactBitsComponent[]> {
      const query = options.query?.toLowerCase() || '';
      let components = await this.listComponents({ category: options.category });
    
      // Filter by search query
      components = components.filter(comp =>
        comp.name.toLowerCase().includes(query) ||
        comp.slug.toLowerCase().includes(query) ||
        comp.description?.toLowerCase().includes(query) ||
        comp.category.toLowerCase().includes(query)
      );
    
      // Apply limit
      if (options.limit && options.limit > 0) {
        components = components.slice(0, options.limit);
      }
    
      return components;
    }
  • TypeScript interface ComponentSearchOptions defining the shape of search options: query (string), category (optional string), style (optional ComponentStyle), and limit (optional number).
    export interface ComponentSearchOptions {
      query: string;
      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 fails to disclose behavioral traits such as read-only nature, result structure, pagination, or any side effects. The minimal description does not compensate for the lack of annotations.

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 a single sentence, which is concise but lacks any structural elements like sections, bullet points, or examples. It is efficient but could be better organized.

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

Completeness2/5

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

Given the absence of an output schema, the description should explain what is returned (e.g., list of components, count, etc.). It does not, leaving the agent without sufficient context about the tool's output or behavior.

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%, so each parameter has a description. The tool description adds context that the query searches by 'name or description', but does not provide examples or format expectations. Thus it adds marginal value over the schema.

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 verb 'Search' and the resource 'ReactBits components', with a specific scope (by name or description). This distinguishes it from sibling tools like get_component (single component retrieval) and list_components (full listing).

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 searching rather than listing or getting a single component, but does not explicitly state when to choose search over list_components or how search differs from them. No alternatives or when-not conditions are mentioned.

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