Skip to content

Commit f69d9e5

Browse files
committed
support array in queries for challenegs
1 parent a6b3884 commit f69d9e5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/mcp/tools/challenges/queryChallenges.parameters.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ export const QUERY_CHALLENGES_TOOL_PARAMETERS = z.object({
3636
.describe(
3737
'Filter by tag name, case-insensitive, partial matches are allowed.',
3838
),
39+
tags: z
40+
.array(z.string())
41+
.optional()
42+
.describe(
43+
'Filter by multiple tag names, case-insensitive, partial matches are allowed.',
44+
),
3945
search: z
4046
.string()
4147
.optional()

src/shared/topcoder/challenges.service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ export class TopcoderChallengesService {
2121
const url = new URL(`${TOPCODER_API_BASE_URL}/challenges`);
2222
Object.entries(queryParams).forEach(([key, value]) => {
2323
if (value !== undefined && value !== null) {
24-
url.searchParams.append(key, value.toString());
24+
if (Array.isArray(value)) {
25+
value.forEach((v) => url.searchParams.append(key, v));
26+
} else {
27+
url.searchParams.append(key, value.toString());
28+
}
2529
}
2630
});
2731

0 commit comments

Comments
 (0)