actionmcp 0.107.0 → 0.107.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 +4 -4
- data/lib/action_mcp/tool.rb +7 -3
- data/lib/action_mcp/types/hash_type.rb +34 -0
- data/lib/action_mcp/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: be05e5d56452910d6c725b15041b68b41b12830f38bd5661ba5c363403ef8df7
|
|
4
|
+
data.tar.gz: 4ead1672cb76e8c1ff4057062f6396cc68d290abf0ab7c0e0562f2d438ddd8a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f0d3ed2611e1347f24a1b6422c9d1628d85cbce23e9b9db13996aca9d9133d03e50bf6b45b26a0f4afa5795314b5285e70e545ecfd2e40ef71294bfc13241b03
|
|
7
|
+
data.tar.gz: fbdf20f97d3324d4adc6d9905ff45dc662ea9a039e6682e884a614fb02a14726b32c17c84785856188d9dea2babbe7aefd9d8d2d0c1c4171facaf69d1dcd02ce
|
data/lib/action_mcp/tool.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "action_mcp/types/float_array_type"
|
|
4
|
+
require "action_mcp/types/hash_type"
|
|
4
5
|
require "action_mcp/schema_helpers"
|
|
5
6
|
|
|
6
7
|
module ActionMCP
|
|
@@ -601,10 +602,13 @@ module ActionMCP
|
|
|
601
602
|
# @return [Symbol] The corresponding ActiveModel attribute type.
|
|
602
603
|
def self.map_json_type_to_active_model_type(type)
|
|
603
604
|
case type.to_s
|
|
604
|
-
when "number"
|
|
605
|
-
when "
|
|
605
|
+
when "number" then :float # JSON Schema "number" maps to float; no distinct integer type in JSON Schema number.
|
|
606
|
+
when "integer" then :integer
|
|
607
|
+
when "boolean" then :boolean
|
|
608
|
+
when "object" then Types::HashType.new
|
|
609
|
+
when "array_number" then :float_array
|
|
606
610
|
when "array_integer" then :integer_array
|
|
607
|
-
when "array_string"
|
|
611
|
+
when "array_string" then :string_array
|
|
608
612
|
else :string
|
|
609
613
|
end
|
|
610
614
|
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ActionMCP
|
|
4
|
+
module Types
|
|
5
|
+
# Custom ActiveModel type for JSON Schema "object" properties.
|
|
6
|
+
# Preserves Hash values without coercion.
|
|
7
|
+
class HashType < ActiveModel::Type::Value
|
|
8
|
+
def type
|
|
9
|
+
:hash
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def cast(value)
|
|
13
|
+
case value
|
|
14
|
+
when Hash then value
|
|
15
|
+
when String
|
|
16
|
+
begin
|
|
17
|
+
parsed = JSON.parse(value)
|
|
18
|
+
parsed.is_a?(Hash) ? parsed : nil
|
|
19
|
+
rescue JSON::ParserError
|
|
20
|
+
nil
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def serialize(value)
|
|
26
|
+
cast(value)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def deserialize(value)
|
|
30
|
+
cast(value)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
data/lib/action_mcp/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: actionmcp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.107.
|
|
4
|
+
version: 0.107.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Abdelkader Boudih
|
|
@@ -260,6 +260,7 @@ files:
|
|
|
260
260
|
- lib/action_mcp/tools_registry.rb
|
|
261
261
|
- lib/action_mcp/transport.rb
|
|
262
262
|
- lib/action_mcp/types/float_array_type.rb
|
|
263
|
+
- lib/action_mcp/types/hash_type.rb
|
|
263
264
|
- lib/action_mcp/uri_ambiguity_checker.rb
|
|
264
265
|
- lib/action_mcp/version.rb
|
|
265
266
|
- lib/actionmcp.rb
|
|
@@ -302,7 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
302
303
|
- !ruby/object:Gem::Version
|
|
303
304
|
version: '0'
|
|
304
305
|
requirements: []
|
|
305
|
-
rubygems_version:
|
|
306
|
+
rubygems_version: 4.0.3
|
|
306
307
|
specification_version: 4
|
|
307
308
|
summary: Lightweight Model Context Protocol (MCP) server toolkit for Ruby/Rails
|
|
308
309
|
test_files: []
|