edit_project_wiki_page
Modify an existing GitLab project wiki page by updating content, title, format, or slug. Use this tool to maintain accurate and up-to-date project documentation efficiently.
Instructions
Edit an existing wiki page for a GitLab project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | ||
| format | No | ||
| project_id | No | ||
| slug | No | ||
| title | No |
Implementation Reference
- src/gitlab-api.ts:966-1003 (handler)Core handler function that sends a PUT request to the GitLab API to edit the specified project wiki page.async editProjectWikiPage( projectId: string, slug: string, options: { title?: string; content?: string; format?: WikiPageFormat; } ): Promise<GitLabWikiPage> { const response = await fetch( `${this.apiUrl}/projects/${encodeURIComponent(projectId)}/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:540-546 (schema)Zod schema defining the input parameters for the edit_project_wiki_page tool.export const EditProjectWikiPageSchema = z.object({ project_id: z.string(), slug: z.string(), title: z.string().optional(), content: z.string().optional(), format: WikiPageFormatEnum.optional() });
- src/index.ts:211-216 (registration)Tool registration in the ALL_TOOLS array, defining name, description, input schema, and read-only status.{ name: "edit_project_wiki_page", description: "Edit an existing wiki page for a GitLab project", inputSchema: createJsonSchema(EditProjectWikiPageSchema), readOnly: false },
- src/index.ts:593-601 (handler)Dispatch handler in the main CallToolRequest switch that parses args and calls the GitLab API method.case "edit_project_wiki_page": { const args = EditProjectWikiPageSchema.parse(request.params.arguments); const wikiPage = await gitlabApi.editProjectWikiPage(args.project_id, args.slug, { title: args.title, content: args.content, format: args.format }); return formatWikiPageResponse(wikiPage); }