Class: RailsAiBridge::Tools::UseSkill
- Extended by:
- UsageFormatter
- Defined in:
- lib/rails_ai_bridge/tools/use_skill.rb
Overview
MCP tool that resolves a skill and returns it framed for immediate application.
Whereas rails_resolve_skill returns content for inspection, this tool wraps
the resolved skill in an application directive (intent header, deprecation
notice when redirected, follow-through footer) so the assistant treats it as
instructions to execute rather than reference material to read.
Constant Summary
Constants included from UsageFormatter
RailsAiBridge::Tools::UsageFormatter::NOT_FOUND_AGENT_MESSAGE, RailsAiBridge::Tools::UsageFormatter::NOT_FOUND_SKILL_MESSAGE, RailsAiBridge::Tools::UsageFormatter::NO_REGISTRY_MESSAGE, RailsAiBridge::Tools::UsageFormatter::USAGE_FOOTERS, RailsAiBridge::Tools::UsageFormatter::USAGE_VERBS
Class Method Summary collapse
-
.call(name:, _server_context: nil) ⇒ MCP::Tool::Response
:reek:TooManyStatements -- linear tool flow: resolver, resolve, deprecation, render.
Methods included from UsageFormatter
Methods included from Registry::Truncatable
Methods inherited from BaseTool
cached_context, cached_section, config, rails_app, reset_cache!, text_response
Class Method Details
.call(name:, _server_context: nil) ⇒ MCP::Tool::Response
:reek:TooManyStatements -- linear tool flow: resolver, resolve, deprecation, render
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/rails_ai_bridge/tools/use_skill.rb', line 39 def self.call(name:, _server_context: nil) resolver = Registry.build_resolver return text_response(format(UsageFormatter::NO_REGISTRY_MESSAGE, path: manifest_path)) unless resolver resolved = resolver.resolve_skill(name) return text_response(format(UsageFormatter::NOT_FOUND_SKILL_MESSAGE, name: name)) unless resolved warning = resolver.check_deprecated(name) text_response(format_usage(resolved, kind: :skill, deprecation_warning: warning)) end |