edit_group_wiki_page
Update and manage GitLab group wiki pages by modifying content, title, format, and slug. Supports markdown, rdoc, asciidoc, and org formats for enhanced collaboration.
Instructions
Edit an existing wiki page for a GitLab group
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | ||
| format | No | ||
| group_id | No | ||
| slug | No | ||
| title | No |
Implementation Reference
- src/gitlab-api.ts:1237-1274 (handler)Core handler function in GitLabApi class that executes the PUT request to the GitLab API endpoint for editing a group wiki page.async editGroupWikiPage( groupId: string, slug: string, options: { title?: string; content?: string; format?: WikiPageFormat; } ): Promise<GitLabWikiPage> { const response = await fetch( `${this.apiUrl}/groups/${encodeURIComponent(groupId)}/wikis/${encodeURIComponent(slug)}`, { method: "PUT", headers: { Authorization: `Bearer ${this.token}`, "Content-Type": "application/json", }, body: JSON.stringify({ title: options.title, content: options.content, format: options.format, }), } ); 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:579-585 (schema)Zod schema defining the input validation for the tool: requires group_id and slug, optional title, content, and format.export const EditGroupWikiPageSchema = z.object({ group_id: z.string(), slug: z.string(), title: z.string().optional(), content: z.string().optional(), format: WikiPageFormatEnum.optional() });
- src/index.ts:249-252 (registration)Tool registration in ALL_TOOLS array, defining name, description, input schema, and read-only status for listTools.name: "edit_group_wiki_page", description: "Edit an existing wiki page for a GitLab group", inputSchema: createJsonSchema(EditGroupWikiPageSchema), readOnly: false
- src/index.ts:647-655 (handler)Dispatch handler in the main CallToolRequest switch statement that parses args and calls the GitLabApi.editGroupWikiPage method.case "edit_group_wiki_page": { const args = EditGroupWikiPageSchema.parse(request.params.arguments); const wikiPage = await gitlabApi.editGroupWikiPage(args.group_id, args.slug, { title: args.title, content: args.content, format: args.format }); return formatWikiPageResponse(wikiPage); }