ask-mcp 0.4.4 → 0.4.5
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 +11 -0
- data/lib/ask/mcp/adapters/tool_server.rb +19 -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: 5d5c902336445279874512b3b83fea5c1f19b0de0640ceefe6d0bc61c6dd6f4e
|
|
4
|
+
data.tar.gz: a4b94e8307ef2d7b8aa2b2a6fee63a14dd45584f910f6db1c1db4b0826728699
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ef659cb4cedd858c26a7cb8acb5a5cbef3f7dc4d4ec8bd88967cfbcb0437e94d333eb34d7336147298b172ea04fd1715bcae7e2de2ba5133e0b3b81a3d3cd1bf
|
|
7
|
+
data.tar.gz: 2bf513b38edd2eb62c72ad385908c7483972d11a802f22c5f6b7f8389110d55f2650c5c7ac6ba4a733a135a5de3424b35f2437455d43f466667dfe22c1a3c88d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [0.4.5] - 2026-08-12
|
|
2
|
+
|
|
3
|
+
### Added
|
|
4
|
+
|
|
5
|
+
- **`structuredContent` mirroring in ToolServer results** — success results
|
|
6
|
+
now include a machine-readable `structuredContent` field (MCP 2025-06-18)
|
|
7
|
+
populated from the JSON text when it parses to an object or array. MCP
|
|
8
|
+
clients that render structured views (e.g. ZCode's "Structured content"
|
|
9
|
+
section) now display the parsed result instead of an empty block. Plain
|
|
10
|
+
text and `:summary` shorthand outputs are unaffected.
|
|
11
|
+
|
|
1
12
|
## [0.4.4] - 2026-08-10
|
|
2
13
|
|
|
3
14
|
### Fixed
|
|
@@ -61,7 +61,7 @@ module Ask
|
|
|
61
61
|
def wrap_result(result)
|
|
62
62
|
# Plain strings are always a success
|
|
63
63
|
if result.is_a?(String)
|
|
64
|
-
return
|
|
64
|
+
return text_result(result)
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
# Result-like objects (Ask::Result, OpenStruct, etc.)
|
|
@@ -79,7 +79,7 @@ module Ask
|
|
|
79
79
|
else
|
|
80
80
|
result.to_s
|
|
81
81
|
end
|
|
82
|
-
|
|
82
|
+
text_result(text)
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
def success_result(result, _ok)
|
|
@@ -89,13 +89,29 @@ module Ask
|
|
|
89
89
|
else
|
|
90
90
|
output.to_s
|
|
91
91
|
end
|
|
92
|
-
|
|
92
|
+
text_result(text)
|
|
93
93
|
end
|
|
94
94
|
|
|
95
95
|
def error_result(message)
|
|
96
96
|
{ content: [{ type: "text", text: "Error: #{message}" }], isError: true }
|
|
97
97
|
end
|
|
98
98
|
|
|
99
|
+
# Builds a success result. Mirrors JSON text into `structuredContent`
|
|
100
|
+
# (MCP 2025-06-18) when it parses, so clients can render a structured
|
|
101
|
+
# view instead of an empty section.
|
|
102
|
+
def text_result(text)
|
|
103
|
+
{ content: [{ type: "text", text: text }], isError: false }.merge(structured_content_for(text))
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def structured_content_for(text)
|
|
107
|
+
parsed = JSON.parse(text)
|
|
108
|
+
return {} unless parsed.is_a?(Hash) || parsed.is_a?(Array)
|
|
109
|
+
|
|
110
|
+
{ structuredContent: parsed }
|
|
111
|
+
rescue JSON::ParserError
|
|
112
|
+
{}
|
|
113
|
+
end
|
|
114
|
+
|
|
99
115
|
def deep_stringify_keys(obj)
|
|
100
116
|
case obj
|
|
101
117
|
when Hash then obj.each_with_object({}) { |(k, v), h| h[k.to_s] = deep_stringify_keys(v) }
|
data/lib/ask/mcp/version.rb
CHANGED