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();
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool lists rules with specific attributes, but lacks details on permissions required, pagination behavior, rate limits, or whether the operation is safe (read-only). For a list operation with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves beyond its basic function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('List all available rules') and specifies the returned attributes. There is no wasted verbiage, repetition, or unnecessary elaboration, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate for a basic list operation. It covers the purpose and output attributes, but lacks behavioral context like safety or performance traits. Without annotations or output schema, the description does the minimum viable job but could be more complete by addressing missing behavioral aspects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, meaning there are no parameters to document. The description correctly implies no filtering parameters by stating 'all available rules', adding value by clarifying the tool's scope. This aligns with the schema's empty properties, so the description compensates appropriately for the lack of parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('all available rules') along with specific attributes returned (IDs, names, categories). It distinguishes from siblings like 'get_rule' (singular) and 'get_rules' (potentially filtered) by emphasizing 'all available' without filtering parameters. However, it doesn't explicitly differentiate from 'search_specification' which might overlap in scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get_rules' or 'search_specification'. The description implies a comprehensive listing, but there's no explicit mention of prerequisites, when-not-to-use scenarios, or comparison to sibling tools that might offer filtered or specific rule retrieval.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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