@therealchristhomas/gitlab-mcp-server
Version:
MCP Server for GitLab API operations
17 lines (16 loc) • 699 B
JavaScript
import { gitlabGet, buildSearchParams } from "../utils/gitlab-client.js";
import { GitLabGroupSearchResponseSchema } from "../types/index.js";
export async function searchGroups(query, page = 1, perPage = 20, owned, minAccessLevel) {
const params = buildSearchParams({
search: query,
page: page.toString(),
per_page: perPage.toString(),
...(owned !== undefined && { owned: owned.toString() }),
...(minAccessLevel !== undefined && { min_access_level: minAccessLevel.toString() })
});
const groups = await gitlabGet("/groups", params);
return GitLabGroupSearchResponseSchema.parse({
count: groups.length,
items: groups
});
}