Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions server.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
36 changes: 36 additions & 0 deletions src/tools/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, unknown>;
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"];
Expand All @@ -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", () => {
Expand Down
2 changes: 2 additions & 0 deletions src/tools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2893,6 +2893,7 @@ OTHER BUILT-IN EVENTS:
blocks: {
type: "array",
description: "Updated Sequenzy block JSON for the step",
items: { type: "object" },
},
},
},
Expand Down Expand Up @@ -2939,6 +2940,7 @@ OTHER BUILT-IN EVENTS:
blocks: {
type: "array",
description: "Updated Sequenzy block JSON for the step",
items: { type: "object" },
},
},
},
Expand Down