Skip to main content
Glama

search_components

Find Modus Web Components by name or keyword to access documentation, design guidelines, and implementation details for your projects.

Instructions

Search for Modus Web Components by name or keyword. Returns a list of matching components with brief descriptions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (component name, keyword, or feature)

Implementation Reference

  • The handler function that implements the search_components tool logic, searching loaded component docs for the query and returning matching results.
    private async searchComponents(query: string): Promise<any> { const normalizedQuery = query.toLowerCase(); const results: Array<{ component: string; filename: string; relevance: string; }> = []; for (const doc of this.docs) { const content = doc.content.toLowerCase(); const componentName = doc.component.toLowerCase(); if ( componentName.includes(normalizedQuery) || content.includes(normalizedQuery) ) { // Extract the first paragraph or description const lines = doc.content.split("\n"); let description = ""; for (const line of lines) { if ( line.trim() && !line.startsWith("#") && !line.startsWith("Tag:") ) { description = line.trim(); break; } } results.push({ component: doc.component, filename: doc.filename, relevance: description || "Modus Web Component", }); } } if (results.length === 0) { return { content: [ { type: "text", text: `No components found matching "${query}". Try searching for common UI elements like "button", "input", "modal", "card", etc.`, }, ], }; } const resultText = results .map((r) => `**${r.component}**\n${r.relevance}\n`) .join("\n"); return { content: [ { type: "text", text: `Found ${results.length} component(s) matching "${query}":\n\n${resultText}`, }, ], }; }
  • Input schema for the search_components tool, defining the required 'query' parameter.
    inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query (component name, keyword, or feature)", }, }, required: ["query"], },
  • src/index.ts:165-180 (registration)
    Registration of the search_components tool in the ListToolsRequestSchema handler, including name, description, and input schema.
    { name: "search_components", description: "Search for Modus Web Components by name or keyword. Returns a list of matching components with brief descriptions.", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query (component name, keyword, or feature)", }, }, required: ["query"], }, },
  • src/index.ts:304-305 (registration)
    Dispatch/registration in the CallToolRequestSchema switch statement that maps the tool call to the searchComponents handler.
    case "search_components": return await this.searchComponents((args?.query as string) || "");

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/julianoczkowski/mcp-modus'

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