list_all_components
Lists all available Modus Web Components with their categories to help developers quickly identify and access the complete component library for their projects.
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 handler function for list_all_components tool. It groups all loaded component documentation files by their 'Category' extracted from the markdown content and generates a formatted Markdown list of components 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, including 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-204 (schema)Input schema definition for list_all_components tool, which takes no parameters.inputSchema: { type: "object", properties: {}, },
- src/index.ts:312-313 (handler)Dispatch case in CallToolRequestHandler that routes calls to the list_all_components handler.case "list_all_components": return await this.listAllComponents();