Class: RosettAi::Mcp::Tools::ProjectTool

Inherits:
Object
  • Object
show all
Defined in:
lib/rosett_ai/mcp/tools/project_tool.rb

Overview

MCP tool: show project status and information.

Returns project lifecycle status, info, or drift detection. Read-only operation.

Author:

  • hugo

  • claude

Constant Summary collapse

TOOL_NAME =
'rai_project'
DESCRIPTION =
'Show rai project status, info, or drift detection'
ANNOTATIONS =
{
  'readOnlyHint' => true,
  'destructiveHint' => false,
  'idempotentHint' => true,
  'openWorldHint' => false
}.freeze
VALID_ACTIONS =
['status', 'info', 'drift'].freeze

Instance Method Summary collapse

Instance Method Details

#call(action: 'status') ⇒ Hash

Executes the project query.

Parameters:

  • action (String) (defaults to: 'status')

    one of 'status', 'info', 'drift'

Returns:

  • (Hash)

    project information



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/rosett_ai/mcp/tools/project_tool.rb', line 33

def call(action: 'status')
  return ResponseHelper.error("Invalid action: #{action}") unless VALID_ACTIONS.include?(action)

  case action
  when 'status' then action_status
  when 'info' then action_info
  when 'drift' then action_drift
  end
rescue StandardError => e
  ResponseHelper.error("Project #{action} failed: #{e.message}")
end