Skip to main content
Glama
ceorkm

ReactBits MCP Server

by ceorkm

search_components

Find ReactBits components by name or description using search queries and category filters to locate animated React components for development projects.

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

  • Main handler function that performs the component search by filtering the component registry based on the query string, category, and limit.
    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;
    }
  • MCP server tool call handler for 'search_components' that validates input and delegates to ReactBitsService.
    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),
          },
        ],
      };
    }
  • src/index.ts:69-90 (registration)
    Tool registration in the MCP tools list, defining name, description, and input schema.
    {
      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'],
      },
    },
  • TypeScript interface defining the input options for the search_components tool.
    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 of behavioral disclosure. It mentions searching but doesn't describe key traits like whether results are paginated, sorted, or limited by default, what happens if no matches are found, or if there are rate limits or authentication requirements. This leaves significant gaps for a search operation.

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 with zero waste—it directly states the tool's purpose without redundancy. It's appropriately sized and front-loaded, making it easy to scan and understand quickly.

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 no annotations, no output schema, and a search tool with three parameters, the description is incomplete. It lacks details on behavioral traits (e.g., result format, error handling), usage context, and doesn't compensate for the absence of structured fields, leaving the agent with insufficient information for reliable invocation.

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 (query, category, limit) with basic descriptions. The description adds minimal value by implying 'query' searches name/description, but doesn't provide additional syntax, format details, or examples beyond what the schema offers.

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 ('Search for') and target resource ('ReactBits components'), specifying searchable fields ('by name or description'). It distinguishes from siblings like 'list_components' by implying a filtered search rather than a full listing, though it doesn't explicitly name alternatives.

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 explicit guidance on when to use this tool versus alternatives like 'list_components' or 'get_component' is provided. The description implies usage for searching by name/description, but lacks context on prerequisites, exclusions, or specific scenarios where this tool is preferred.

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