Skip to main content
Glama

list_rules

Lists available UI component rules with IDs, names, and categories for compliance checking and validation against the components.build specification.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for 'list_rules' tool. It fetches all rules using getAllRules(), groups them by category, formats a markdown list with severity emojis, IDs, names, and weights, and returns it as ToolResult.
    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 }], }; }
  • Tool schema definition in getToolDefinitions(). Defines the tool name, description, and empty input schema (no parameters required).
    { name: 'list_rules', description: 'List all available rules with their IDs, names, and categories', inputSchema: { type: 'object', properties: {}, }, },
  • Registration in the executeTool switch statement, dispatching calls to list_rules to the handleListRules 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