Class: KairosMcp::Tools::CapabilityStatus

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

Overview

Phase 1.5 — capability_status MCP tool.

Self-articulation surface for KairosChain. Returns a 4-layer view:

  • declared: static manifest aggregated from registered tools

  • observed: runtime detection of active_harness + used_externals

  • delivery_channels: harness-delivered content surfaces (CLAUDE.md/MEMORY.md auto-load etc.)

  • tension: informational mismatches between declared and observed

Each section has its own ‘tier_used:` annotation honestly reporting which tier of operation produced that data (Acknowledgment invariant).

Design reference: docs/drafts/capability_boundary_design_v1.1.md §5

Instance Method Summary collapse

Methods inherited from BaseTool

#examples, #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



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/kairos_mcp/tools/capability_status.rb', line 75

def call(arguments)
  include_observed = arguments.fetch('include_observed', true)
  probe_externals  = arguments.fetch('probe_externals',  false)
  probe_versions   = arguments.fetch('probe_versions',   false)
  filter_tier      = arguments['filter_tier']&.to_sym

  manifest = Capability.aggregate_manifest(@registry)
  declared_section = build_declared_section(manifest, filter_tier)

  result = {
    kairos_version: kairos_version,
    acknowledgment: 'KairosChain capability boundary self-articulation. Each section reports its own tier_used.',
    declared: declared_section,
    delivery_channels: build_delivery_channels_section,
    notes: notes
  }

  if include_observed
    result[:observed] = build_observed_section(manifest, probe_externals, probe_versions)
    result[:tension] = build_tension_section(manifest, result[:observed])
  end

  text_content(JSON.pretty_generate(result))
rescue StandardError => e
  text_content(JSON.pretty_generate(error: e.message, error_class: e.class.name,
                                    backtrace: e.backtrace&.first(5)))
end

#categoryObject



30
31
32
# File 'lib/kairos_mcp/tools/capability_status.rb', line 30

def category
  :guide
end

#descriptionObject



26
27
28
# File 'lib/kairos_mcp/tools/capability_status.rb', line 26

def description
  'Self-articulation of KairosChain capability boundary. Returns declared / observed / delivery_channels / tension layers, each annotated with the tier_used to produce it. Phase 1.5 — addresses Claude Code vs KairosChain feature conflation by making harness dependence explicit.'
end

#harness_requirementObject

The capability_status tool itself is :core when probe_externals: false (default). The output’s external_availability section, when included, is :harness_assisted but is honestly self-labeled in the response.



45
46
47
# File 'lib/kairos_mcp/tools/capability_status.rb', line 45

def harness_requirement
  :core
end

#input_schemaObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/kairos_mcp/tools/capability_status.rb', line 49

def input_schema
  {
    type: 'object',
    properties: {
      include_observed: {
        type: 'boolean',
        description: 'Include observed (runtime) section. Default: true. When false, observed/tension/external_availability are all omitted.'
      },
      probe_externals: {
        type: 'boolean',
        description: 'Probe external CLI availability via PATH check. Default: false (no probing). When true, external_availability section is added with tier_used: :harness_assisted.'
      },
      probe_versions: {
        type: 'boolean',
        description: 'When probe_externals: true, also fetch each CLI --version via subprocess. Default: false. Adds version field to external_availability entries.'
      },
      filter_tier: {
        type: 'string',
        enum: %w[core harness_assisted harness_specific],
        description: 'Filter declared.tools to only this tier.'
      }
    },
    required: []
  }
end

#nameObject



22
23
24
# File 'lib/kairos_mcp/tools/capability_status.rb', line 22

def name
  'capability_status'
end


38
39
40
# File 'lib/kairos_mcp/tools/capability_status.rb', line 38

def related_tools
  %w[knowledge_get hello_world]
end

#usecase_tagsObject



34
35
36
# File 'lib/kairos_mcp/tools/capability_status.rb', line 34

def usecase_tags
  %w[capability harness boundary self-articulation phase1.5 acknowledgment]
end