Class: RosettAi::Mcp::Tools::ProvenanceTool
- Inherits:
-
Object
- Object
- RosettAi::Mcp::Tools::ProvenanceTool
- Defined in:
- lib/rosett_ai/mcp/tools/provenance_tool.rb
Overview
MCP tool: query AI provenance information.
Validates, shows, and logs provenance entries. Read-only operation.
Constant Summary collapse
- TOOL_NAME =
'rai_provenance'- DESCRIPTION =
'Query AI provenance (validate, show, log)'- ANNOTATIONS =
{ 'readOnlyHint' => true, 'destructiveHint' => false, 'idempotentHint' => true, 'openWorldHint' => false }.freeze
- VALID_ACTIONS =
['validate', 'show', 'log'].freeze
Instance Method Summary collapse
-
#call(action: 'log', commit: nil, file: nil, role: nil) ⇒ Hash
Executes the provenance query.
Instance Method Details
#call(action: 'log', commit: nil, file: nil, role: nil) ⇒ Hash
Executes the provenance query.
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/rosett_ai/mcp/tools/provenance_tool.rb', line 36 def call(action: 'log', commit: nil, file: nil, role: nil) return ResponseHelper.error("Invalid action: #{action}") unless VALID_ACTIONS.include?(action) tracker = RosettAi::Provenance::Tracker.new case action when 'validate' then action_validate(tracker) when 'show' then action_show(tracker, commit: commit, file: file) when 'log' then action_log(tracker, role: role) end rescue StandardError => e ResponseHelper.error("Provenance #{action} failed: #{e.}") end |