Skip to main content
Glama

create_project_wiki_page

Automate the creation of a new wiki page for a GitLab project, specifying title, content, format, and project ID to streamline documentation processes.

Instructions

Create a new wiki page for a GitLab project

Input Schema

NameRequiredDescriptionDefault
contentNo
formatNo
project_idNo
titleNo

Input Schema (JSON Schema)

{ "properties": { "content": { "type": "string" }, "format": { "enum": [ "markdown", "rdoc", "asciidoc", "org" ], "type": "string" }, "project_id": { "type": "string" }, "title": { "type": "string" } }, "type": "object" }

Implementation Reference

  • Primary MCP tool handler: parses arguments using the schema, delegates to GitLabApi.createProjectWikiPage, and returns formatted response.
    case "create_project_wiki_page": { const args = CreateProjectWikiPageSchema.parse(request.params.arguments); const wikiPage = await gitlabApi.createProjectWikiPage(args.project_id, { title: args.title, content: args.content, format: args.format }); return formatWikiPageResponse(wikiPage); }
  • GitLab API client method implementing the wiki page creation via POST to /projects/{projectId}/wikis endpoint.
    async createProjectWikiPage( projectId: string, options: { title: string; content: string; format?: WikiPageFormat; } ): Promise<GitLabWikiPage> { const response = await fetch( `${this.apiUrl}/projects/${encodeURIComponent(projectId)}/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); }
  • Zod input schema for the tool defining required parameters: project_id, title, content; optional format.
    export const CreateProjectWikiPageSchema = z.object({ project_id: z.string(), title: z.string(), content: z.string(), format: WikiPageFormatEnum.optional() });
  • src/index.ts:206-209 (registration)
    Tool definition in ALL_TOOLS array used for registration in listTools response and read-only filtering.
    name: "create_project_wiki_page", description: "Create a new wiki page for a GitLab project", inputSchema: createJsonSchema(CreateProjectWikiPageSchema), readOnly: false

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yoda-digital/mcp-gitlab-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server