Skip to content
Merged
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
8 changes: 4 additions & 4 deletions mcp-server/src/tools/runs/find-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)."),
Expand All @@ -28,7 +28,7 @@ const handler = async ({
projectId,
ciBuildId,
branch,
tag,
tags,
pwLastRun,
}: z.infer<typeof zodSchema>) => {
const queryParams = new URLSearchParams();
Expand All @@ -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) {
Expand Down
30 changes: 15 additions & 15 deletions mcp-server/src/tools/runs/get-runs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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."),
Expand All @@ -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()
Expand All @@ -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,
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down
38 changes: 19 additions & 19 deletions mcp-server/src/tools/tests/get-test-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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<typeof zodSchema>) => {
const queryParams = new URLSearchParams();
Expand All @@ -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) {
Expand Down