Skip to main content
Glama

get_design_rules

Retrieve specific design rules for Modus Web Components, including colors, icons, spacing, typography, and other design system guidelines.

Instructions

Get specific design rules for Modus Web Components (colors, icons, spacing, typography, etc.).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesThe design rule category (e.g., "colors", "icons", "spacing", "typography", "breakpoints", "radius_stroke")

Implementation Reference

  • The core handler function implementing the 'get_design_rules' tool. It normalizes the category input, searches the loaded rules array for a matching rule document by category name or filename, and returns the markdown content as a tool response or an error listing available categories if not found.
    private async getDesignRules(category: string): Promise<any> { const normalizedCategory = category.toLowerCase(); const rule = this.rules.find( (r) => r.category.toLowerCase() === normalizedCategory || r.filename.toLowerCase().includes(normalizedCategory) ); if (!rule) { const availableCategories = this.rules.map((r) => r.category).join(", "); return { content: [ { type: "text", text: `Design rule category "${category}" not found.\n\nAvailable categories: ${availableCategories}`, }, ], }; } return { content: [ { type: "text", text: rule.content, }, ], }; }
  • src/index.ts:223-237 (registration)
    Registration of the 'get_design_rules' tool in the ListToolsRequestSchema handler, including the tool name, description, and input schema definition.
    name: "get_design_rules", description: "Get specific design rules for Modus Web Components (colors, icons, spacing, typography, etc.).", inputSchema: { type: "object", properties: { category: { type: "string", description: 'The design rule category (e.g., "colors", "icons", "spacing", "typography", "breakpoints", "radius_stroke")', }, }, required: ["category"], }, },
  • src/index.ts:320-321 (registration)
    Dispatch/registration in the CallToolRequestSchema switch statement that routes calls to the getDesignRules handler method with the category argument.
    case "get_design_rules": return await this.getDesignRules((args?.category as string) || "");
  • Helper method that loads design rules from markdown files in the rules directory into the this.rules array, which is used by the getDesignRules 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`); }

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