list_all_components
Retrieve a complete list of Modus Web Components grouped by category, enabling quick identification and selection of the right component for your project.
Instructions
List all available Modus Web Components with their categories.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:446-481 (handler)The `listAllComponents` method iterates over loaded component docs, extracts categories from markdown content via regex, groups component names by category, and returns a formatted text response listing all components 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 (schema)The tool definition with name 'list_all_components', description 'List all available Modus Web Components with their categories.', and an empty inputSchema (no parameters required).
{ name: "list_all_components", description: "List all available Modus Web Components with their categories.", inputSchema: { type: "object", properties: {}, }, }, - src/index.ts:312-313 (registration)The switch-case in CallToolRequestSchema handler that routes 'list_all_components' to the listAllComponents method.
case "list_all_components": return await this.listAllComponents();