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 =

Returns MCP tool identifier string.

Returns:

  • (String)

    MCP tool identifier string.

'rai_project'
DESCRIPTION =

Returns Human-readable description of this tool.

Returns:

  • (String)

    Human-readable description of this tool.

'Show rai project status, info, or drift detection'
ANNOTATIONS =

Returns MCP protocol annotations describing tool capabilities.

Returns:

  • (Hash)

    MCP protocol annotations describing tool capabilities.

{
  'readOnlyHint' => true,
  'destructiveHint' => false,
  'idempotentHint' => true,
  'openWorldHint' => false
}.freeze
VALID_ACTIONS =

Returns Set of permitted action values.

Returns:

  • (Array)

    Set of permitted action values.

['status', 'info', 'drift'].freeze
INPUT_SCHEMA =

Returns JSON Schema defining the tool input parameters.

Returns:

  • (Hash)

    JSON Schema defining the tool input parameters.

{
  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



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/rosett_ai/mcp/tools/project_tool.rb', line 49

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