list_design_categories
Retrieve available design rule categories to access documentation for component usage, guidelines, and project setup in your IDE.
Instructions
List all available design rule categories.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:641-675 (handler)The handler function `listDesignCategories` that generates a formatted markdown list of all loaded design rule categories with brief descriptions extracted from their content.private async listDesignCategories(): Promise<any> { let resultText = `# Modus Design Rules (${this.rules.length} categories)\n\n`; for (const rule of this.rules.sort((a, b) => a.category.localeCompare(b.category) )) { // Extract brief description from content const lines = rule.content.split("\n"); let description = "Design guidelines and specifications"; for (const line of lines) { if ( line.trim() && !line.startsWith("#") && !line.startsWith("---") && line.length > 10 ) { description = line.trim().substring(0, 100) + (line.length > 100 ? "..." : ""); break; } } resultText += `## ${rule.category}\n${description}\n\n`; } return { content: [ { type: "text", text: resultText, }, ], }; }
- src/index.ts:253-260 (registration)Tool registration in the ListToolsRequestSchema handler, defining the tool name, description, and empty input schema (no parameters required).{ name: "list_design_categories", description: "List all available design rule categories.", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:326-327 (registration)Dispatch case in the CallToolRequestSchema switch statement that invokes the listDesignCategories handler method.case "list_design_categories": return await this.listDesignCategories();
- src/index.ts:256-259 (schema)Input schema definition for the tool: an empty object (no input parameters required).inputSchema: { type: "object", properties: {}, },
- src/index.ts:112-133 (helper)Helper method `loadRules` that loads design rule markdown files from the rules directory into the `this.rules` array used by the handler.private loadRules(): void { if (!existsSync(this.rulesPath)) { console.error(`Rules directory not found at: ${this.rulesPath}`); console.error("Please run: node download-docs.js"); return; } const files = readdirSync(this.rulesPath).filter((f) => f.endsWith(".md")); for (const file of files) { const content = readFileSync(join(this.rulesPath, file), "utf-8"); const category = file.replace(".md", "").replace("modus_", ""); this.rules.push({ filename: file, category, content, }); } console.error(`Loaded ${this.rules.length} design rules files`); }