skedyul 0.1.11 → 0.1.12
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/server.js +10 -8
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -431,20 +431,22 @@ function createSkedyulServer(config, registry) {
|
|
|
431
431
|
const toolName = tool.name || toolKey;
|
|
432
432
|
const inputZodSchema = getZodSchema(tool.inputs);
|
|
433
433
|
const outputZodSchema = getZodSchema(tool.outputSchema);
|
|
434
|
-
|
|
434
|
+
// Wrap the input schema to accept Skedyul format: { inputs: {...}, env: {...} }
|
|
435
|
+
// This allows the MCP SDK to pass through the wrapper without stripping fields
|
|
436
|
+
const wrappedInputSchema = z.object({
|
|
437
|
+
inputs: inputZodSchema ?? z.record(z.string(), z.unknown()).optional(),
|
|
438
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
439
|
+
}).passthrough();
|
|
435
440
|
mcpServer.registerTool(toolName, {
|
|
436
441
|
title: toolName,
|
|
437
442
|
description: tool.description,
|
|
438
|
-
inputSchema:
|
|
443
|
+
inputSchema: wrappedInputSchema,
|
|
439
444
|
outputSchema: outputZodSchema,
|
|
440
445
|
}, async (args) => {
|
|
441
|
-
//
|
|
442
|
-
// 1. Skedyul format: { inputs: {...}, env: {...} }
|
|
443
|
-
// 2. Standard MCP format: { ...directArgs }
|
|
446
|
+
// Args are in Skedyul format: { inputs: {...}, env: {...} }
|
|
444
447
|
const rawArgs = args;
|
|
445
|
-
const
|
|
446
|
-
const
|
|
447
|
-
const toolEnv = hasSkedyulFormat ? rawArgs.env : undefined;
|
|
448
|
+
const toolInputs = (rawArgs.inputs ?? {});
|
|
449
|
+
const toolEnv = rawArgs.env;
|
|
448
450
|
const validatedInputs = inputZodSchema ? inputZodSchema.parse(toolInputs) : toolInputs;
|
|
449
451
|
const result = await callTool(toolKey, {
|
|
450
452
|
inputs: validatedInputs,
|