get_group_wiki_page
Retrieve a specific wiki page for a GitLab group, with options to render HTML content and specify the version, using input parameters like group ID and page slug.
Instructions
Get a specific wiki page for a GitLab group
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group_id | No | ||
| render_html | No | ||
| slug | No | ||
| version | No |
Input Schema (JSON Schema)
{
"properties": {
"group_id": {
"type": "string"
},
"render_html": {
"type": "boolean"
},
"slug": {
"type": "string"
},
"version": {
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/gitlab-api.ts:1142-1180 (handler)Core implementation of the getGroupWikiPage function in GitLabApi class. Fetches a specific wiki page from a GitLab group via API GET request to /groups/{groupId}/wikis/{slug}, with optional render_html and version params. Parses response with GitLabWikiPageSchema.async getGroupWikiPage( groupId: string, slug: string, options: { render_html?: boolean; version?: string; } = {} ): Promise<GitLabWikiPage> { const url = new URL( `${this.apiUrl}/groups/${encodeURIComponent(groupId)}/wikis/${encodeURIComponent(slug)}` ); // Add query parameters if (options.render_html) { url.searchParams.append("render_html", "true"); } if (options.version) { url.searchParams.append("version", options.version); } 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 wikiPage = await response.json(); // Validate and return the response return GitLabWikiPageSchema.parse(wikiPage); }
- src/schemas.ts:565-570 (schema)Zod input schema for get_group_wiki_page tool, defining required group_id and slug, optional render_html and version.export const GetGroupWikiPageSchema = z.object({ group_id: z.string(), slug: z.string(), render_html: z.boolean().optional(), version: z.string().optional() });
- src/index.ts:236-240 (registration)Tool registration in ALL_TOOLS array, defining name, description, inputSchema from GetGroupWikiPageSchema, marked readOnly.{ name: "get_group_wiki_page", description: "Get a specific wiki page for a GitLab group", inputSchema: createJsonSchema(GetGroupWikiPageSchema), readOnly: true
- src/index.ts:628-635 (handler)Dispatch handler in main switch statement: parses args with schema, calls gitlabApi.getGroupWikiPage, formats response with formatWikiPageResponse.case "get_group_wiki_page": { const args = GetGroupWikiPageSchema.parse(request.params.arguments); const wikiPage = await gitlabApi.getGroupWikiPage(args.group_id, args.slug, { render_html: args.render_html, version: args.version }); return formatWikiPageResponse(wikiPage); }