delete_project_wiki_page
Remove a wiki page from a GitLab project by specifying the project ID and page slug. Ideal for maintaining clean and updated project documentation.
Instructions
Delete a wiki page from a GitLab project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | ||
| slug | No |
Input Schema (JSON Schema)
{
"properties": {
"project_id": {
"type": "string"
},
"slug": {
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/index.ts:603-606 (handler)MCP tool handler in the CallToolRequest switch statement. Parses arguments using the schema and delegates to gitlabApi.deleteProjectWikiPage, then returns success message.case "delete_project_wiki_page": { const args = DeleteProjectWikiPageSchema.parse(request.params.arguments); await gitlabApi.deleteProjectWikiPage(args.project_id, args.slug); return { content: [{ type: "text", text: `Wiki page '${args.slug}' has been deleted.` }] };
- src/gitlab-api.ts:1013-1033 (helper)Core implementation function that performs the actual DELETE request to GitLab API to delete the project wiki page.async deleteProjectWikiPage( projectId: string, slug: string ): Promise<void> { const response = await fetch( `${this.apiUrl}/projects/${encodeURIComponent(projectId)}/wikis/${encodeURIComponent(slug)}`, { method: "DELETE", headers: { Authorization: `Bearer ${this.token}`, }, } ); if (!response.ok) { throw new McpError( ErrorCode.InternalError, `GitLab API error: ${response.statusText}` ); } }
- src/schemas.ts:548-551 (schema)Zod schema defining input parameters: project_id and slug for the wiki page.export const DeleteProjectWikiPageSchema = z.object({ project_id: z.string(), slug: z.string() });
- src/index.ts:218-221 (registration)Tool registration in ALL_TOOLS array, defining name, description, input schema, and readOnly flag.name: "delete_project_wiki_page", description: "Delete a wiki page from a GitLab project", inputSchema: createJsonSchema(DeleteProjectWikiPageSchema), readOnly: false