{
"event": "PreToolUse",
"tool_name": "mcp__mcp-db__db_select",
"tool_input": {
"query": "SELECT \n CASE \n WHEN ca.file_path LIKE '%\/Controller\/%' THEN 'Controller'\n WHEN ca.file_path LIKE '%\/Entity\/%' THEN 'Entity'\n WHEN ca.file_path LIKE '%\/Repository\/%' OR ca.file_path LIKE '%\/Persistence\/%' THEN 'Repository'\n WHEN ca.file_path LIKE '%\/Service\/%' THEN 'Service'\n WHEN ca.file_path LIKE '%\/UseCase%' THEN 'UseCase'\n WHEN ca.file_path LIKE '%\/Infrastructure\/%' THEN 'Infrastructure'\n ELSE 'Other'\n END as layer,\n COUNT(*) as files_with_issues,\n SUM(cq.issues_count) as total_issues,\n ROUND(AVG(cq.hygiene_score)) as avg_score\nFROM code_quality cq\nJOIN code_analysis ca ON ca.id = cq.analysis_id\nWHERE cq.issues_count > 0\nGROUP BY layer\nORDER BY total_issues DESC",
"database": "ki_dev"
}
}
{
"tool_response": [
{
"type": "text",
"text": "{\n \"status\": \"success\",\n \"data\": [\n {\n \"layer\": \"Other\",\n \"files_with_issues\": 85,\n \"total_issues\": \"208\",\n \"avg_score\": \"86\"\n },\n {\n \"layer\": \"Infrastructure\",\n \"files_with_issues\": 13,\n \"total_issues\": \"35\",\n \"avg_score\": \"89\"\n },\n {\n \"layer\": \"UseCase\",\n \"files_with_issues\": 14,\n \"total_issues\": \"28\",\n \"avg_score\": \"90\"\n },\n {\n \"layer\": \"Repository\",\n \"files_with_issues\": 17,\n \"total_issues\": \"18\",\n \"avg_score\": \"93\"\n },\n {\n \"layer\": \"Controller\",\n \"files_with_issues\": 3,\n \"total_issues\": \"8\",\n \"avg_score\": \"89\"\n },\n {\n \"layer\": \"Entity\",\n \"files_with_issues\": 4,\n \"total_issues\": \"6\",\n \"avg_score\": \"62\"\n }\n ],\n \"row_count\": 6,\n \"error\": null,\n \"execution_ms\": 1\n}"
}
]
}