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
INPUT_SCHEMA =
{
  type: 'object',
  properties: {
    action: {
      type: 'string',
      enum: ['status', 'info', 'drift'],
      description: 'Project action (default: status)'
    }
  }
}.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



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/rosett_ai/mcp/tools/project_tool.rb', line 44

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