create_group_wiki_page
Generate a new wiki page for a GitLab group by specifying title, content, format, and group ID. Simplify documentation management within GitLab projects.
Instructions
Create a new wiki page for a GitLab group
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | ||
| format | No | ||
| group_id | No | ||
| title | No |
Input Schema (JSON Schema)
{
"properties": {
"content": {
"type": "string"
},
"format": {
"enum": [
"markdown",
"rdoc",
"asciidoc",
"org"
],
"type": "string"
},
"group_id": {
"type": "string"
},
"title": {
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/index.ts:637-645 (handler)MCP server tool handler: parses input schema, calls GitLab API helper, and formats response.case "create_group_wiki_page": { const args = CreateGroupWikiPageSchema.parse(request.params.arguments); const wikiPage = await gitlabApi.createGroupWikiPage(args.group_id, { title: args.title, content: args.content, format: args.format }); return formatWikiPageResponse(wikiPage); }
- src/schemas.ts:572-577 (schema)Zod input schema validation for tool parameters: group_id, title, content, optional format.export const CreateGroupWikiPageSchema = z.object({ group_id: z.string(), title: z.string(), content: z.string(), format: WikiPageFormatEnum.optional() });
- src/index.ts:243-246 (registration)Tool registration in ALL_TOOLS: defines name, description, input schema, and read-only flag.name: "create_group_wiki_page", description: "Create a new wiki page for a GitLab group", inputSchema: createJsonSchema(CreateGroupWikiPageSchema), readOnly: false
- src/gitlab-api.ts:1190-1226 (helper)GitLab API client method: POST request to /groups/{group_id}/wikis endpoint to create wiki page.async createGroupWikiPage( groupId: string, options: { title: string; content: string; format?: WikiPageFormat; } ): Promise<GitLabWikiPage> { const response = await fetch( `${this.apiUrl}/groups/${encodeURIComponent(groupId)}/wikis`, { method: "POST", headers: { Authorization: `Bearer ${this.token}`, "Content-Type": "application/json", }, body: JSON.stringify({ title: options.title, content: options.content, format: options.format || "markdown", }), } ); 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); }