skedyul 1.0.21 → 1.0.22
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/.build-stamp +1 -1
- package/dist/server/index.js +15 -5
- package/dist/server/serverless.js +14 -5
- package/package.json +1 -1
package/dist/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1773977763410
|
package/dist/server/index.js
CHANGED
|
@@ -204,11 +204,21 @@ function createSkedyulServer(config, registry, webhookRegistry) {
|
|
|
204
204
|
// Note: effect is embedded in structuredContent because the MCP SDK
|
|
205
205
|
// transport strips custom top-level fields in dedicated mode
|
|
206
206
|
const outputData = result.output;
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
207
|
+
const hasOutputSchema = Boolean(outputZodSchema);
|
|
208
|
+
// MCP SDK requires structuredContent when outputSchema is defined
|
|
209
|
+
// Always provide it (even as empty object) to satisfy validation
|
|
210
|
+
let structuredContent;
|
|
211
|
+
if (outputData) {
|
|
212
|
+
structuredContent = { ...outputData, __effect: result.effect };
|
|
213
|
+
}
|
|
214
|
+
else if (result.effect) {
|
|
215
|
+
structuredContent = { __effect: result.effect };
|
|
216
|
+
}
|
|
217
|
+
else if (hasOutputSchema) {
|
|
218
|
+
// Tool has outputSchema but returned null/undefined output
|
|
219
|
+
// Provide empty object to satisfy MCP SDK validation
|
|
220
|
+
structuredContent = {};
|
|
221
|
+
}
|
|
212
222
|
return {
|
|
213
223
|
content: [{ type: 'text', text: JSON.stringify(result.output) }],
|
|
214
224
|
structuredContent,
|
|
@@ -640,11 +640,20 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
640
640
|
}
|
|
641
641
|
else {
|
|
642
642
|
const outputData = toolResult.output;
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
643
|
+
// MCP SDK requires structuredContent when outputSchema is defined
|
|
644
|
+
// Always provide it (even as empty object) to satisfy validation
|
|
645
|
+
let structuredContent;
|
|
646
|
+
if (outputData) {
|
|
647
|
+
structuredContent = { ...outputData, __effect: toolResult.effect };
|
|
648
|
+
}
|
|
649
|
+
else if (toolResult.effect) {
|
|
650
|
+
structuredContent = { __effect: toolResult.effect };
|
|
651
|
+
}
|
|
652
|
+
else if (hasOutputSchema) {
|
|
653
|
+
// Tool has outputSchema but returned null/undefined output
|
|
654
|
+
// Provide empty object to satisfy MCP SDK validation
|
|
655
|
+
structuredContent = {};
|
|
656
|
+
}
|
|
648
657
|
result = {
|
|
649
658
|
content: [{ type: 'text', text: JSON.stringify(toolResult.output) }],
|
|
650
659
|
structuredContent,
|