Class: TalkToYourApp::Plugins::Cache::ClearTool
- Defined in:
- lib/talk_to_your_app/plugins/cache/plugin.rb
Overview
Clears the host app's cache store. Destructive (every cached entry is
dropped, and the app re-warms from cold), so it lives in its own opt-in
plugin rather than shipping enabled anywhere by default. Scope it to
trusted principals with config.authorize.
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
17 18 19 20 |
# File 'lib/talk_to_your_app/plugins/cache/plugin.rb', line 17 def call(_args, _ctx) Rails.cache.clear json(cleared: true, store: Rails.cache.class.name) end |