From e91c51f66f7041be228789080b8474bb3af05a86 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 11 Feb 2026 03:32:48 +0000 Subject: [PATCH] Fix parameter naming parity with OpenAPI spec - Updated get-runs.ts: Use branches[], tags[], authors[] instead of deprecated branch, tag, author - Updated get-test-results.ts: Use branches[], tags[], authors[], groups[] instead of deprecated branch, tag, git_author, group - Updated find-run.ts: Use tags[] instead of deprecated tag[] These changes align MCP tools with the current OpenAPI specification which uses bracket notation for array parameters. --- mcp-server/src/tools/runs/find-run.ts | 8 ++-- mcp-server/src/tools/runs/get-runs.ts | 30 +++++++-------- .../src/tools/tests/get-test-results.ts | 38 +++++++++---------- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/mcp-server/src/tools/runs/find-run.ts b/mcp-server/src/tools/runs/find-run.ts index 861d88f..ddc0b17 100644 --- a/mcp-server/src/tools/runs/find-run.ts +++ b/mcp-server/src/tools/runs/find-run.ts @@ -14,7 +14,7 @@ const zodSchema = z.object({ .string() .optional() .describe("Git branch name. Used when ciBuildId is not provided."), - tag: z + tags: z .array(z.string()) .optional() .describe("Run tags to filter by (can be specified multiple times)."), @@ -28,7 +28,7 @@ const handler = async ({ projectId, ciBuildId, branch, - tag, + tags, pwLastRun, }: z.infer) => { const queryParams = new URLSearchParams(); @@ -42,8 +42,8 @@ const handler = async ({ queryParams.append("branch", branch); } - if (tag && tag.length > 0) { - tag.forEach((t) => queryParams.append("tag[]", t)); + if (tags && tags.length > 0) { + tags.forEach((t) => queryParams.append("tags[]", t)); } if (pwLastRun !== undefined) { diff --git a/mcp-server/src/tools/runs/get-runs.ts b/mcp-server/src/tools/runs/get-runs.ts index b5ade3f..c6282a1 100644 --- a/mcp-server/src/tools/runs/get-runs.ts +++ b/mcp-server/src/tools/runs/get-runs.ts @@ -22,11 +22,11 @@ const zodSchema = z.object({ .describe( "Cursor for pagination. Returns items before this cursor value." ), - branch: z - .string() + branches: z + .array(z.string()) .optional() - .describe("Filter runs by git branch name."), - tag: z + .describe("Filter runs by git branch names (can be specified multiple times)."), + tags: z .array(z.string()) .optional() .describe("Filter runs by tags (can be specified multiple times). Use tag_operator to control matching behavior."), @@ -38,10 +38,10 @@ const zodSchema = z.object({ .string() .optional() .describe("Search runs by ciBuildId or commit message. Case-insensitive."), - author: z + authors: z .array(z.string()) .optional() - .describe("Filter runs by git commit author name (can be specified multiple times)."), + .describe("Filter runs by git commit author names (can be specified multiple times)."), status: z .array(z.enum(["PASSED", "FAILED", "RUNNING", "FAILING"])) .optional() @@ -65,11 +65,11 @@ const handler = async ({ limit = 10, starting_after, ending_before, - branch, - tag, + branches, + tags, tag_operator, search, - author, + authors, status, completion_state, date_start, @@ -86,12 +86,12 @@ const handler = async ({ queryParams.append("ending_before", ending_before); } - if (branch) { - queryParams.append("branch", branch); + if (branches && branches.length > 0) { + branches.forEach((b) => queryParams.append("branches[]", b)); } - if (tag && tag.length > 0) { - tag.forEach((t) => queryParams.append("tag", t)); + if (tags && tags.length > 0) { + tags.forEach((t) => queryParams.append("tags[]", t)); } if (tag_operator) { @@ -102,8 +102,8 @@ const handler = async ({ queryParams.append("search", search); } - if (author && author.length > 0) { - author.forEach((a) => queryParams.append("author", a)); + if (authors && authors.length > 0) { + authors.forEach((a) => queryParams.append("authors[]", a)); } if (status && status.length > 0) { diff --git a/mcp-server/src/tools/tests/get-test-results.ts b/mcp-server/src/tools/tests/get-test-results.ts index fce56b9..7f91c3b 100644 --- a/mcp-server/src/tools/tests/get-test-results.ts +++ b/mcp-server/src/tools/tests/get-test-results.ts @@ -26,26 +26,26 @@ const zodSchema = z.object({ .describe( "Cursor for pagination. Returns items before this cursor value." ), - branch: z + branches: z .array(z.string()) .optional() - .describe("Filter by git branch (can be specified multiple times)."), - tag: z + .describe("Filter by git branches (can be specified multiple times)."), + tags: z .array(z.string()) .optional() .describe("Filter by run tags (can be specified multiple times)."), - git_author: z + authors: z .array(z.string()) .optional() - .describe("Filter by git author (can be specified multiple times)."), + .describe("Filter by git authors (can be specified multiple times)."), status: z .array(z.enum(["passed", "failed", "pending", "skipped"])) .optional() .describe("Filter by test status (can be specified multiple times)."), - group: z + groups: z .array(z.string()) .optional() - .describe("Filter by run group (can be specified multiple times)."), + .describe("Filter by run groups (can be specified multiple times)."), flaky: z .boolean() .optional() @@ -59,11 +59,11 @@ const handler = async ({ limit = 10, starting_after, ending_before, - branch, - tag, - git_author, + branches, + tags, + authors, status, - group, + groups, flaky, }: z.infer) => { const queryParams = new URLSearchParams(); @@ -79,24 +79,24 @@ const handler = async ({ queryParams.append("ending_before", ending_before); } - if (branch && branch.length > 0) { - branch.forEach((b) => queryParams.append("branch", b)); + if (branches && branches.length > 0) { + branches.forEach((b) => queryParams.append("branches[]", b)); } - if (tag && tag.length > 0) { - tag.forEach((t) => queryParams.append("tag", t)); + if (tags && tags.length > 0) { + tags.forEach((t) => queryParams.append("tags[]", t)); } - if (git_author && git_author.length > 0) { - git_author.forEach((a) => queryParams.append("git_author[]", a)); + if (authors && authors.length > 0) { + authors.forEach((a) => queryParams.append("authors[]", a)); } if (status && status.length > 0) { status.forEach((s) => queryParams.append("status[]", s)); } - if (group && group.length > 0) { - group.forEach((g) => queryParams.append("group[]", g)); + if (groups && groups.length > 0) { + groups.forEach((g) => queryParams.append("groups[]", g)); } if (flaky !== undefined) {