Class: RosettAi::Mcp::Tools::ComplyTool
- Inherits:
-
Object
- Object
- RosettAi::Mcp::Tools::ComplyTool
- Defined in:
- lib/rosett_ai/mcp/tools/comply_tool.rb
Overview
MCP tool: run rosett-ai compliance checks.
Executes CRA, license, and SPDX header checks. Read-only operation — does not modify any files.
Constant Summary collapse
- TOOL_NAME =
'rai_comply'- DESCRIPTION =
'Run rosett-ai compliance checks (CRA, license, SPDX headers)'- ANNOTATIONS =
{ 'readOnlyHint' => true, 'destructiveHint' => false, 'idempotentHint' => true, 'openWorldHint' => false }.freeze
Instance Method Summary collapse
-
#call(cra: false, license: false, headers: false, format: 'json') ⇒ Hash
Executes compliance checks.
Instance Method Details
#call(cra: false, license: false, headers: false, format: 'json') ⇒ Hash
Executes compliance checks.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/rosett_ai/mcp/tools/comply_tool.rb', line 34 def call(cra: false, license: false, headers: false, format: 'json') checker = RosettAi::Compliance::Checker.new results = checker.check(cra: cra, license: license, headers: headers) { compliant: results[:violations].empty?, violations: results[:violations], checks_run: results[:checks_run], format: format } rescue StandardError => e ResponseHelper.error("Compliance check failed: #{e.}") end |