Class: Collavre::McpTool

Inherits:
ApplicationRecord show all
Defined in:
app/models/collavre/mcp_tool.rb

Instance Method Summary collapse

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'app/models/collavre/mcp_tool.rb', line 14

def active?
  approved_at.present?
end

#approve!Object



22
23
24
25
26
# File 'app/models/collavre/mcp_tool.rb', line 22

def approve!
  # Register the tool immediately upon approval
  ::McpService.register_tool_from_source(source_code)
  update!(approved_at: Time.current)
end

#requires_approval?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/models/collavre/mcp_tool.rb', line 18

def requires_approval?
  requires_approval == true
end