list_all_components
Discover all available Modus Web Components and their categories to identify design system elements for your project.
Instructions
List all available Modus Web Components with their categories.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:446-481 (handler)The core handler function that implements the list_all_components tool. It categorizes loaded component documentation files by extracting 'Category' from content and generates a markdown-formatted list grouped by category.private async listAllComponents(): Promise<any> { const componentsByCategory: Record<string, string[]> = {}; for (const doc of this.docs) { // Extract category from content const categoryMatch = doc.content.match(/Category:\s*([^\n]+)/i); const category = categoryMatch ? categoryMatch[1].trim() : "Other"; if (!componentsByCategory[category]) { componentsByCategory[category] = []; } componentsByCategory[category].push(doc.component); } let resultText = `# Modus Web Components (${this.docs.length} components)\n\n`; for (const [category, components] of Object.entries( componentsByCategory ).sort()) { resultText += `## ${category}\n`; resultText += components .sort() .map((c) => `- ${c}`) .join("\n"); resultText += "\n\n"; } return { content: [ { type: "text", text: resultText, }, ], }; }
- src/index.ts:197-205 (registration)Registration of the list_all_components tool in the ListToolsRequestHandler. Defines the tool name, description, and input schema (no required parameters).{ name: "list_all_components", description: "List all available Modus Web Components with their categories.", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:201-205 (schema)Input schema for the list_all_components tool, specifying an empty object (no input parameters required).inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:312-313 (handler)Dispatcher case in CallToolRequestHandler that routes calls to the listAllComponents method.case "list_all_components": return await this.listAllComponents();