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
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The component source code to check |
Implementation Reference
- src/tools/index.ts:453-476 (handler)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 }], }; }
- src/tools/index.ts:145-158 (schema)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'], }, },
- src/tools/index.ts:245-246 (registration)The switch case in executeTool that registers and dispatches to the check_compliance handler.case 'check_compliance': return handleCheckCompliance(args);