Module: Reeve::Integrations::FastMcp::ToolExtension

Defined in:
lib/reeve/integrations/fast_mcp/tool_extension.rb

Overview

Routes every fast-mcp tool call through the envelope.

Prepended to each tool subclass rather than to FastMcp::Tool itself: a prepended module precedes the class's own methods, but a module prepended to the parent still sits behind the subclass's call. Prepending at inherited time works even though call is defined afterwards, which is what makes this impossible to forget — there is no "remember to wrap your tool" step.

Instance Method Summary collapse

Instance Method Details

#call(**arguments) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/reeve/integrations/fast_mcp/tool_extension.rb', line 15

def call(**arguments)
  attributes = ContextBuilder.attributes(self)

  Reeve.invoke(
    tool: self.class,
    arguments: arguments,
    agent: attributes[:agent],
    metadata: attributes[:metadata]
  ) { super(**arguments) }
end