active_mcp 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1891356bb19d256dcbd11f7d441fb9c5f668fc9cc0b115ea17eec44aef99ee54
4
- data.tar.gz: 8031f7e13bfd5a837cf84ff3ca069bd5c56b46901e7e04c861d6c15eabcf2c94
3
+ metadata.gz: 6663bc950db47a5719e93db048f5601acb9dd58b87421fe0eb94e2c78cec2333
4
+ data.tar.gz: ffacf7506cc82ad8fc680dd57f3f74ee50875e8bb7053ff460dc28e59c232cfa
5
5
  SHA512:
6
- metadata.gz: 20438f69b5a08fa089187a1eb11c0f0e8ccc5525809439e45da36105411b7c62187a981f0a73deda52fdb292ede1ffc429aaa26d0a21f2a5a369b9601bd2306d
7
- data.tar.gz: cf9c750474af01cc72c1a8480c568c36a29d271b7c7a9f5a2bf5ecdec8cc42e1fc0fe70493ae6e9a82d3f431445aca068a881fc89c71c6181f976384c8b0e2ca
6
+ metadata.gz: 6631c864d9b2fbf566f5202eb31c16a4cb0154a0bcac33b23165c365adab03a01b7ee54da8996dd87660c78046457d2baa6c23f1e1e4dd5a57ea6c06601d84ca
7
+ data.tar.gz: b3f85f31d012218cafba456a4ebe9b50de9261686aec9b40d1f48a783e74bf6dba9506e113fb0d4372f8e5f82b6000911ec40016151063759d1b2865b68c7abe
@@ -4,5 +4,6 @@ module ActiveMcp
4
4
  class BaseController < ActionController::Base
5
5
  include RequestHandlable
6
6
  include ResourceReadable
7
+ include ToolExecutable
7
8
  end
8
9
  end
@@ -48,7 +48,7 @@ module ActiveMcp
48
48
  @format = :jsonrpc
49
49
  render 'active_mcp/tools_list', formats: :json
50
50
  when Method::TOOLS_CALL
51
- @tool_result = ActiveMcp::ToolExecutor.execute(params: params, auth_info: auth_info)
51
+ @tool_result = execute_tool(params: params, auth_info: auth_info)
52
52
  @format = :jsonrpc
53
53
  render 'active_mcp/tools_call', formats: :json
54
54
  else
@@ -74,7 +74,7 @@ module ActiveMcp
74
74
  @format = :json
75
75
  render 'active_mcp/tools_list', formats: :json
76
76
  when Method::TOOLS_CALL
77
- @tool_result = ActiveMcp::ToolExecutor.execute(params: params, auth_info: auth_info)
77
+ @tool_result = execute_tool(params: params, auth_info: auth_info)
78
78
  @format = :json
79
79
  render 'active_mcp/tools_call', formats: :json
80
80
  else
@@ -41,7 +41,7 @@ module ActiveMcp
41
41
  end
42
42
 
43
43
  begin
44
- if content = resource.text
44
+ if resource.respond_to?(:text) && content = resource.text
45
45
  return {
46
46
  contents: [
47
47
  {
@@ -1,6 +1,10 @@
1
1
  module ActiveMcp
2
- class ToolExecutor
3
- def self.execute(params:, auth_info:)
2
+ module ToolExecutable
3
+ extend ActiveSupport::Concern
4
+
5
+ private
6
+
7
+ def execute_tool(params:, auth_info:)
4
8
  if params[:jsonrpc].present?
5
9
  tool_name = params[:params][:name]
6
10
  tool_params = params[:params][:arguments]
@@ -105,7 +109,7 @@ module ActiveMcp
105
109
  end
106
110
  end
107
111
 
108
- def self.formatted(object)
112
+ def formatted(object)
109
113
  case object
110
114
  when String
111
115
  object
@@ -1,3 +1,3 @@
1
1
  module ActiveMcp
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_mcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moeki Kawakami
@@ -70,7 +70,7 @@ files:
70
70
  - app/controllers/active_mcp/base_controller.rb
71
71
  - app/controllers/concerns/active_mcp/request_handlable.rb
72
72
  - app/controllers/concerns/active_mcp/resource_readable.rb
73
- - app/models/active_mcp/tool_executor.rb
73
+ - app/controllers/concerns/active_mcp/tool_executable.rb
74
74
  - app/views/active_mcp/cancelled.json.jbuilder
75
75
  - app/views/active_mcp/initialize.json.jbuilder
76
76
  - app/views/active_mcp/initialized.json.jbuilder