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 CHANGED
@@ -1 +1 @@
1
- 1773896446931
1
+ 1773977763410
@@ -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 structuredContent = outputData
208
- ? { ...outputData, __effect: result.effect }
209
- : result.effect
210
- ? { __effect: result.effect }
211
- : undefined;
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
- const structuredContent = outputData
644
- ? { ...outputData, __effect: toolResult.effect }
645
- : toolResult.effect
646
- ? { __effect: toolResult.effect }
647
- : undefined;
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skedyul",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "The Skedyul SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",