Class: TalkToYourApp::Plugins::Flipper::Tools::ListFlags

Inherits:
Tool
  • Object
show all
Defined in:
lib/talk_to_your_app/plugins/flipper/tools/list_flags.rb

Overview

Lists the keys of all configured feature flags.

Instance Method Summary collapse

Methods inherited from Tool

argument, arguments, clear_custom_registry!, connection, custom_registry, default_arguments, description, dispatch, inherited, input_schema_hash, invoke, name, normalize_response, to_mcp_definition, to_mcp_tool, tool_name

Instance Method Details

#call(_args, ctx) ⇒ Object



15
16
17
18
19
20
# File 'lib/talk_to_your_app/plugins/flipper/tools/list_flags.rb', line 15

def call(_args, ctx)
  names = ctx.connection { ::Flipper.features.map(&:key) }
  json(flags: names.sort)
rescue StandardError => e
  error("Flipper storage unavailable: #{e.class}: #{e.message}")
end