Skip to main content
Glama

check_compliance

Verify component source code meets compliance standards by scoring it against specifications to ensure it passes required thresholds.

Instructions

Quick check if component code is compliant (score >= 80)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe component source code to check

Implementation Reference

  • The handler function for the 'check_compliance' tool. It invokes gradeComponent on the input code, checks if the score is >= 80, and formats a compliance report with status, score, and any violations or confirmation of passing.
    function handleCheckCompliance(args: Record<string, unknown>): ToolResult {
      const code = args.code as string;
      const result = gradeComponent(code);
    
      const isCompliant = result.score >= 80;
      const status = isCompliant ? '✅ COMPLIANT' : '❌ NOT COMPLIANT';
    
      const text = `# ${status}
    
    **Score:** ${result.score}/100 (${result.grade})
    **Threshold:** 80/100
    
    ${
      result.violations.length > 0
        ? `## Issues to Fix (${result.violations.length})
    ${result.violations.map((v) => `- ${v.message}${v.suggestion ? ` → ${v.suggestion}` : ''}`).join('\n')}`
        : '## All checks passed!'
    }
    `;
    
      return {
        content: [{ type: 'text', text }],
      };
    }
  • The input schema and definition for the 'check_compliance' tool, specifying that it requires a 'code' string parameter.
    {
      name: 'check_compliance',
      description: 'Quick check if component code is compliant (score >= 80)',
      inputSchema: {
        type: 'object',
        properties: {
          code: {
            type: 'string',
            description: 'The component source code to check',
          },
        },
        required: ['code'],
      },
    },
  • The switch case in executeTool that registers and dispatches to the check_compliance handler.
    case 'check_compliance':
      return handleCheckCompliance(args);

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