list_group_wiki_pages
Retrieve all wiki pages for a GitLab group, optionally including content, to organize and manage group knowledge resources efficiently.
Instructions
List all wiki pages for a GitLab group
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group_id | No | ||
| with_content | No |
Input Schema (JSON Schema)
{
"properties": {
"group_id": {
"type": "string"
},
"with_content": {
"type": "boolean"
}
},
"type": "object"
}
Implementation Reference
- src/gitlab-api.ts:1095-1131 (handler)Core handler function in GitLabApi class that lists wiki pages for a group by calling the GitLab API.async listGroupWikiPages( groupId: string, options: { with_content?: boolean; } = {} ): Promise<GitLabWikiPagesResponse> { const url = new URL( `${this.apiUrl}/groups/${encodeURIComponent(groupId)}/wikis` ); // Add query parameters if (options.with_content) { url.searchParams.append("with_content", "true"); } const response = await fetch(url.toString(), { headers: { Authorization: `Bearer ${this.token}`, }, }); if (!response.ok) { throw new McpError( ErrorCode.InternalError, `GitLab API error: ${response.statusText}` ); } // Parse the response JSON const wikiPages = await response.json() as any[]; // Validate and return the response return GitLabWikiPagesResponseSchema.parse({ count: wikiPages.length, items: wikiPages, }); }
- src/schemas.ts:560-563 (schema)Zod schema defining the input parameters for the tool: group_id (required) and with_content (optional).export const ListGroupWikiPagesSchema = z.object({ group_id: z.string(), with_content: z.boolean().optional() });
- src/index.ts:231-235 (registration)Tool registration in the ALL_TOOLS array, defining name, description, input schema, and read-only status.name: "list_group_wiki_pages", description: "List all wiki pages for a GitLab group", inputSchema: createJsonSchema(ListGroupWikiPagesSchema), readOnly: true },
- src/index.ts:620-626 (handler)MCP server handler case that parses input, calls the GitLab API method, and formats the response.case "list_group_wiki_pages": { const args = ListGroupWikiPagesSchema.parse(request.params.arguments); const wikiPages = await gitlabApi.listGroupWikiPages(args.group_id, { with_content: args.with_content }); return formatWikiPagesResponse(wikiPages); }