Class: KairosMcp::Tools::ChainVerify

Inherits:
BaseTool
  • Object
show all
Defined in:
lib/kairos_mcp/tools/chain_verify.rb

Instance Method Summary collapse

Methods inherited from BaseTool

#harness_requirement, #initialize, #invoke_tool, #to_full_schema, #to_schema

Constructor Details

This class inherits a constructor from KairosMcp::Tools::BaseTool

Instance Method Details

#call(arguments) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/kairos_mcp/tools/chain_verify.rb', line 43

def call(arguments)
  chain = KairosChain::Chain.new

  # Three outcomes, not two: a ledger that does not exist yet is a fresh
  # install, not a corrupted one.
  case chain.load_state
  when :readable
    text_content("Blockchain Integrity Verified: OK (Length: #{chain.chain.length})")
  when :absent
    text_content('Blockchain not created yet (state: absent). Nothing to verify.')
  else
    text_content("Blockchain Integrity Check FAILED! (state: #{chain.load_state})")
  end
end

#categoryObject



15
16
17
# File 'lib/kairos_mcp/tools/chain_verify.rb', line 15

def category
  :chain
end

#descriptionObject



11
12
13
# File 'lib/kairos_mcp/tools/chain_verify.rb', line 11

def description
  'Verify the integrity of the entire blockchain.'
end

#examplesObject



23
24
25
26
27
28
29
30
# File 'lib/kairos_mcp/tools/chain_verify.rb', line 23

def examples
  [
    {
      title: 'Verify blockchain integrity',
      code: 'chain_verify()'
    }
  ]
end

#input_schemaObject



36
37
38
39
40
41
# File 'lib/kairos_mcp/tools/chain_verify.rb', line 36

def input_schema
  {
    type: 'object',
    properties: {}
  }
end

#nameObject



7
8
9
# File 'lib/kairos_mcp/tools/chain_verify.rb', line 7

def name
  'chain_verify'
end


32
33
34
# File 'lib/kairos_mcp/tools/chain_verify.rb', line 32

def related_tools
  %w[chain_status chain_history]
end

#usecase_tagsObject



19
20
21
# File 'lib/kairos_mcp/tools/chain_verify.rb', line 19

def usecase_tags
  %w[verify integrity check blockchain validate]
end