Skip to main content
Glama

list_rules

Lists all available UI component rules with IDs, names, and categories for compliance checking and validation.

Instructions

List all available rules with their IDs, names, and categories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the core logic of the 'list_rules' tool. It fetches all rules, groups them by category, adds severity emojis, and formats them into a markdown list.
    function handleListRules(): ToolResult { const rules = getAllRules(); const byCategory: Record<string, Rule[]> = {}; for (const rule of rules) { if (!byCategory[rule.category]) { byCategory[rule.category] = []; } byCategory[rule.category].push(rule); } let text = '# Available Rules\n\n'; for (const [category, categoryRules] of Object.entries(byCategory)) { text += `## ${category.charAt(0).toUpperCase() + category.slice(1)}\n\n`; for (const rule of categoryRules) { const severityEmoji = rule.severity === 'error' ? '🔴' : rule.severity === 'warning' ? '🟡' : '🔵'; text += `- ${severityEmoji} \`${rule.id}\` - ${rule.name} (weight: ${rule.weight})\n`; } text += '\n'; } return { content: [{ type: 'text', text }], }; }
  • The tool definition including name, description, and empty input schema (no parameters required). This serves as the schema registration for the MCP tool.
    { name: 'list_rules', description: 'List all available rules with their IDs, names, and categories', inputSchema: { type: 'object', properties: {}, }, },
  • The dispatch registration in the executeTool switch statement that maps the tool name to its handler.
    case 'list_rules': return handleListRules();

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/audreyui/components-build-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server