ask-mcp 0.4.3 → 0.4.4
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/CHANGELOG.md +12 -0
- data/lib/ask/mcp/adapters/tool_server.rb +15 -3
- data/lib/ask/mcp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4cccd828fe9bafe8d0873dab258aeef03824f1cce4c425869e9cd777924b7ff7
|
|
4
|
+
data.tar.gz: d30dbfb82b6e75cc953985f7a8035c71b3b1e31681c42fd1e14133ed19208068
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aa666b423416bf1c5b28181ac7fa535165e23fb1d4f9190dfb02f3395b8788c123a5d4c611784f3df59829d118c6b866fa50bf1bd3dfdbddfe43846d0bcedfd1
|
|
7
|
+
data.tar.gz: 407317ef9ab950450398c062cacba0c8c8ee05b1e37c7f81897aac6921937ec1bbb6f69ae331631410615f743989bf1b430175b4329f4071837dfa2e382eca85
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [0.4.4] - 2026-08-10
|
|
2
|
+
|
|
3
|
+
### Fixed
|
|
4
|
+
|
|
5
|
+
- **Hash tool results are JSON-serialized instead of emitted raw** —
|
|
6
|
+
`ToolServer#wrap_result`/`success_result` used `result[:summary]` as the
|
|
7
|
+
content `text` whenever a Hash result had a `summary` key. When `summary`
|
|
8
|
+
was itself a Hash (e.g. `schema_graph`'s summary), the server emitted a
|
|
9
|
+
non-string content item that spec-compliant MCP clients reject. String
|
|
10
|
+
`summary` values are still honored as a shorthand; any other Hash result is
|
|
11
|
+
`JSON.generate`d so `text` is always a String.
|
|
12
|
+
|
|
1
13
|
## [0.4.3] - 2026-08-04
|
|
2
14
|
|
|
3
15
|
### Added
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
3
5
|
module Ask
|
|
4
6
|
module MCP
|
|
5
7
|
module Adapters
|
|
@@ -69,14 +71,24 @@ module Ask
|
|
|
69
71
|
return error_result(result.respond_to?(:error_message) ? result.error_message : result.to_s)
|
|
70
72
|
end
|
|
71
73
|
|
|
72
|
-
# Everything else — treat as success
|
|
73
|
-
text
|
|
74
|
+
# Everything else — treat as success. Hashes are JSON-serialized so
|
|
75
|
+
# the content text is always a String (MCP content items require
|
|
76
|
+
# string `text`). A String `:summary` is honored as a shorthand.
|
|
77
|
+
text = if result.is_a?(Hash)
|
|
78
|
+
result[:summary].is_a?(String) ? result[:summary] : JSON.generate(result)
|
|
79
|
+
else
|
|
80
|
+
result.to_s
|
|
81
|
+
end
|
|
74
82
|
{ content: [{ type: "text", text: text }], isError: false }
|
|
75
83
|
end
|
|
76
84
|
|
|
77
85
|
def success_result(result, _ok)
|
|
78
86
|
output = result.respond_to?(:output) ? result.output : result.to_s
|
|
79
|
-
text = output.is_a?(Hash)
|
|
87
|
+
text = if output.is_a?(Hash)
|
|
88
|
+
output[:summary].is_a?(String) ? output[:summary] : JSON.generate(output)
|
|
89
|
+
else
|
|
90
|
+
output.to_s
|
|
91
|
+
end
|
|
80
92
|
{ content: [{ type: "text", text: text }], isError: false }
|
|
81
93
|
end
|
|
82
94
|
|
data/lib/ask/mcp/version.rb
CHANGED