Skip to main content
Glama

search_components

Find React Native components in Reacticx library by searching names, descriptions, and categories to identify suitable UI elements for your project.

Instructions

Search Reacticx components by keyword. Searches component names, descriptions, and categories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (e.g. 'carousel', 'animation', 'slider', 'loader')

Implementation Reference

  • Core searchComponents handler function that filters COMPONENT_REGISTRY based on query against name, slug, description, and category fields (case-insensitive)
    export function searchComponents(query: string): ComponentInfo[] { const q = query.toLowerCase(); return COMPONENT_REGISTRY.filter( (c) => c.name.toLowerCase().includes(q) || c.slug.toLowerCase().includes(q) || c.description.toLowerCase().includes(q) || c.category.toLowerCase().includes(q) ); }
  • src/index.ts:148-186 (registration)
    MCP tool registration for 'search_components' with Zod schema for query parameter, handling results formatting and empty results
    server.tool( "search_components", "Search Reacticx components by keyword. Searches component names, descriptions, and categories.", { query: z .string() .describe( "Search query (e.g. 'carousel', 'animation', 'slider', 'loader')" ), }, async ({ query }) => { const results = searchComponents(query); if (results.length === 0) { return { content: [ { type: "text" as const, text: `No components found matching "${query}". Try a different keyword.`, }, ], }; } let output = `# Search Results for "${query}" (${results.length} matches)\n\n`; for (const comp of results) { const deps = comp.dependencies.length > 0 ? `\n Dependencies: ${comp.dependencies.join(", ")}` : ""; output += `- **${comp.name}** (\`${comp.slug}\`) [${comp.category}]\n ${comp.description}${deps}\n Install: \`bunx --bun reacticx add ${comp.slug}\`\n\n`; } return { content: [{ type: "text" as const, text: output }], }; } );
  • ComponentInfo interface defining the type structure for component data returned by searchComponents
    export interface ComponentInfo { name: string; slug: string; category: string; description: string; dependencies: string[]; }
  • Zod schema validation for the query parameter of search_components tool
    query: z .string() .describe( "Search query (e.g. 'carousel', 'animation', 'slider', 'loader')" ), },

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/igorfelipeduca/reacticx-mcp'

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