Skip to main content
Glama

check_compliance

Verify component source code meets compliance standards by scoring it against specifications to ensure quality and adherence to requirements.

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 that executes the check_compliance tool. It grades the provided component code using gradeComponent, checks if the score is >= 80, and returns a compliance status with score, grade, and any violation summaries.
    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 tool definition including input schema for check_compliance, used in getToolDefinitions() to register the tool with MCP.
    { 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