Skip to main content
Glama

get_design_rules

Retrieve specific design system rules for Modus Web Components including colors, icons, spacing, typography, and other styling guidelines to maintain consistent UI implementation.

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 primary handler function implementing the 'get_design_rules' tool logic. It normalizes the category input, searches the pre-loaded rules array for a match by category or filename, and returns the corresponding markdown content or an error with available categories.
    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:222-237 (registration)
    Tool registration definition returned by ListToolsRequestSchema handler, specifying the tool name, description, and input schema.
    { 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"], }, },
  • Dispatch case within the CallToolRequestSchema handler that routes calls to the specific getDesignRules method, extracting the category argument.
    case "get_design_rules": return await this.getDesignRules((args?.category as string) || "");
  • Input schema for the 'get_design_rules' tool, defining the required 'category' string parameter with description and examples.
    inputSchema: { type: "object", properties: { category: { type: "string", description: 'The design rule category (e.g., "colors", "icons", "spacing", "typography", "breakpoints", "radius_stroke")', }, }, required: ["category"], },

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