diff --git a/package.json b/package.json index 0b5faf7..255c10b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sequenzy/mcp", - "version": "0.0.39", + "version": "0.0.41", "mcpName": "io.github.sequenzy/mcp", "description": "Sequenzy MCP server for AI-powered email marketing automation", "type": "module", diff --git a/server.json b/server.json index a433615..77eed24 100644 --- a/server.json +++ b/server.json @@ -6,12 +6,12 @@ "url": "https://github.com/Sequenzy/mcp", "source": "github" }, - "version": "0.0.39", + "version": "0.0.41", "packages": [ { "registryType": "npm", "identifier": "@sequenzy/mcp", - "version": "0.0.39", + "version": "0.0.41", "runtime": "node", "transport": { "type": "stdio" diff --git a/src/tools/index.test.ts b/src/tools/index.test.ts index 9c11f9d..4663194 100644 --- a/src/tools/index.test.ts +++ b/src/tools/index.test.ts @@ -46,6 +46,34 @@ function collectSchemaKeywordPaths( return paths; } +function collectArraySchemasWithoutItems( + value: unknown, + path: string +): string[] { + if (Array.isArray(value)) { + return value.flatMap((item, index) => + collectArraySchemasWithoutItems(item, `${path}[${index}]`) + ); + } + + if (typeof value !== "object" || value === null) { + return []; + } + + const record = value as Record; + const paths = + record.type === "array" && + !Object.prototype.hasOwnProperty.call(record, "items") + ? [path] + : []; + + for (const [key, child] of Object.entries(record)) { + paths.push(...collectArraySchemasWithoutItems(child, `${path}.${key}`)); + } + + return paths; +} + describe("tool schema compatibility", () => { it("does not publish unsupported root-level composition keywords", () => { const unsupportedRootKeywords = ["anyOf", "oneOf", "allOf", "enum", "not"]; @@ -71,6 +99,14 @@ describe("tool schema compatibility", () => { expect(violations).toEqual([]); }); + + it("publishes items for every array schema", () => { + const violations = tools.flatMap((tool) => + collectArraySchemasWithoutItems(tool.inputSchema, tool.name) + ); + + expect(violations).toEqual([]); + }); }); describe("update_template tool validation", () => { diff --git a/src/tools/index.ts b/src/tools/index.ts index c9131ba..d6f5c27 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -2893,6 +2893,7 @@ OTHER BUILT-IN EVENTS: blocks: { type: "array", description: "Updated Sequenzy block JSON for the step", + items: { type: "object" }, }, }, }, @@ -2939,6 +2940,7 @@ OTHER BUILT-IN EVENTS: blocks: { type: "array", description: "Updated Sequenzy block JSON for the step", + items: { type: "object" }, }, }, },