@atlassian/mcp-compressor 0.21.2 → 0.21.3
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.
package/dist/tool_specs.js
CHANGED
|
@@ -17,7 +17,26 @@ export function normalizeServerName(name) {
|
|
|
17
17
|
return normalized || "tools";
|
|
18
18
|
}
|
|
19
19
|
export function stringifyToolResult(value) {
|
|
20
|
-
|
|
20
|
+
if (typeof value === "string")
|
|
21
|
+
return value;
|
|
22
|
+
const mcpText = stringifyMcpTextContent(value);
|
|
23
|
+
if (mcpText !== undefined)
|
|
24
|
+
return mcpText;
|
|
25
|
+
return JSON.stringify(value);
|
|
26
|
+
}
|
|
27
|
+
function stringifyMcpTextContent(value) {
|
|
28
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
29
|
+
return undefined;
|
|
30
|
+
const content = value.content;
|
|
31
|
+
if (!Array.isArray(content))
|
|
32
|
+
return undefined;
|
|
33
|
+
const textParts = content.flatMap((item) => {
|
|
34
|
+
if (!item || typeof item !== "object" || Array.isArray(item))
|
|
35
|
+
return [];
|
|
36
|
+
const candidate = item;
|
|
37
|
+
return candidate.type === "text" && typeof candidate.text === "string" ? [candidate.text] : [];
|
|
38
|
+
});
|
|
39
|
+
return textParts.length > 0 ? textParts.join("\n") : undefined;
|
|
21
40
|
}
|
|
22
41
|
export function normalizeStructuredArgValues(schema, input) {
|
|
23
42
|
const properties = schema.properties;
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlassian/mcp-compressor",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.3",
|
|
4
4
|
"description": "TypeScript MCP server wrapper for reducing tokens consumed by MCP tools.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/atlassian-labs/mcp-compressor",
|