Class: TalkToYourApp::Plugins::CustomTools::Plugin
- Inherits:
-
TalkToYourApp::Plugin
- Object
- TalkToYourApp::Plugin
- TalkToYourApp::Plugins::CustomTools::Plugin
- Defined in:
- lib/talk_to_your_app/plugins/custom_tools/plugin.rb
Overview
Exposes every TalkToYourApp::CustomTool subclass over MCP. Unlike the bundled plugins, its tool list is dynamic — whatever subclasses of CustomTool the host app has defined. Tools generated by ‘rails g talk_to_your_app:custom_tool` live in app/talk_to_your_app/custom_tools/ and are loaded automatically here.
Class Method Summary collapse
Methods inherited from TalkToYourApp::Plugin
log_level, requires_connection, requires_gem, validate_enablement!
Class Method Details
.tools ⇒ Object
15 16 17 18 19 20 |
# File 'lib/talk_to_your_app/plugins/custom_tools/plugin.rb', line 15 def self.tools TalkToYourApp.require_app_dir("custom_tools") # Dedup by MCP name (last wins) in case two files declare the same # tool_name, or a class is registered more than once in a process. TalkToYourApp::CustomTool.registry.each_with_object({}) { |t, acc| acc[t.tool_name] = t }.values end |