backlog_add_wiki
Create and add a wiki page to a Backlog project by specifying the project ID, page name, and content. Optionally enable email notifications for updates. Integrates with Backlog API for streamlined project documentation.
Instructions
Add an wiki using the Backlog Wiki API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Content | |
| mailNotify | No | True make to notify by Email | |
| name | Yes | Page Name | |
| projectId | Yes | Project ID |
Implementation Reference
- src/tools/handlers.ts:340-371 (handler)The handler function that executes the core logic of the 'backlog_add_wiki' tool: validates input using AddWikiParamsSchema, calls wikiService.addWiki, and formats the response.const handleAddWiki: ToolHandler = async (args) => { try { try { const validatedParams = AddWikiParamsSchema.parse(args); const text = await wikiService.addWiki(validatedParams); return { content: [ { type: "text", text: `Results for your query:\n${text}`, }, ], isError: false, }; } catch (validationError) { throw new ValidationError( `Invalid parameters: ${validationError instanceof Error ? validationError.message : String(validationError)}`, ); } } catch (error) { return { content: [ { type: "text", text: `Error: ${formatError(error)}`, }, ], isError: true, }; }
- src/tools/handlers.ts:442-455 (registration)Maps the tool name 'backlog_add_wiki' to its handler function handleAddWiki in the toolHandlers registry.export const toolHandlers: Record<ToolName, ToolHandler> = { backlog_get_projects: handleGetProjects, backlog_get_project: handleGetProject, backlog_get_issues: handleGetIssues, backlog_get_issue: handleGetIssue, backlog_add_issue: handleAddIssue, backlog_update_issue: handleUpdateIssue, backlog_delete_issue: handleDeleteIssue, backlog_get_wikis: handleGetWikis, backlog_get_wiki: handleGetWiki, backlog_add_wiki: handleAddWiki, backlog_update_wiki: handleUpdateWiki, backlog_delete_wiki: handleDeleteWiki, };
- src/core/schema.ts:190-195 (schema)Zod schema defining the input parameters for the backlog_add_wiki tool, used for validation in the handler.export const AddWikiParamsSchema = z.object({ projectId: z.number().int().describe("Project ID"), name: z.string().describe("Page Name"), content: z.string().describe("Content"), mailNotify: z.boolean().optional().describe("True make to notify by Email"), });
- src/tools/toolDefinitions.ts:583-587 (schema)Defines the MCP Tool object for 'backlog_add_wiki', including name, description, and input schema conversion.export const ADD_WIKI_TOOL: Tool = createTool( "backlog_add_wiki", "Add an wiki using the Backlog Wiki API.", AddWikiParamsSchema, );
- src/tools/toolDefinitions.ts:337-360 (schema)Converts the Zod AddWikiParamsSchema to JSON Schema for the MCP tool inputSchema, with required fields specified.if (isAddWikiParamsSchema) { return { type: "object" as const, properties: { projectId: { type: "number", description: "Project ID", }, name: { type: "string", description: "Page Name", }, content: { type: "string", description: "Content", }, mailNotify: { type: "boolean", description: "True make to notify by Email", }, }, required: ["projectId", "name", "content"], }; }