keryx 0.15.1 → 0.15.2
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/initializers/mcp.ts +9 -3
- package/package.json +1 -1
package/initializers/mcp.ts
CHANGED
|
@@ -373,9 +373,9 @@ function createMcpServer(): McpServer {
|
|
|
373
373
|
toolConfig.description = action.description;
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
376
|
+
toolConfig.inputSchema = action.inputs
|
|
377
|
+
? sanitizeSchemaForMcp(action.inputs)
|
|
378
|
+
: z4mini.strictObject({});
|
|
379
379
|
|
|
380
380
|
mcpServer.registerTool(
|
|
381
381
|
toolName,
|
|
@@ -601,6 +601,12 @@ function sanitizeSchemaForMcp(schema: any): any {
|
|
|
601
601
|
return schema;
|
|
602
602
|
}
|
|
603
603
|
|
|
604
|
+
// Empty object schemas should use strictObject to produce
|
|
605
|
+
// { type: "object", additionalProperties: false } per MCP spec
|
|
606
|
+
if (Object.entries(schema.shape as Record<string, any>).length === 0) {
|
|
607
|
+
return z4mini.strictObject({});
|
|
608
|
+
}
|
|
609
|
+
|
|
604
610
|
const newShape: Record<string, any> = {};
|
|
605
611
|
let needsSanitization = false;
|
|
606
612
|
|