add_wiki
Creates a wiki page in a Backlog project with specified name, content, and optional notification settings.
Instructions
Creates a new wiki page
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project ID | |
| name | Yes | Name of the wiki page | |
| content | Yes | Content of the wiki page | |
| mailNotify | No | Whether to send notification emails (default: false) | |
| organization | No | Optional organization name. Use list_organizations to inspect available organizations. |
Implementation Reference
- src/tools/addWiki.ts:24-45 (handler)The main tool definition for 'add_wiki'. The handler calls backlog.postWiki() with projectId, name, content, and mailNotify.
export const addWikiTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof addWikiSchema>, (typeof WikiSchema)['shape'] > => { return { name: 'add_wiki', description: t('TOOL_ADD_WIKI_DESCRIPTION', 'Creates a new wiki page'), schema: z.object(addWikiSchema(t)), outputSchema: WikiSchema, importantFields: ['id', 'name', 'content', 'createdUser'], handler: async ({ projectId, name, content, mailNotify }) => backlog.postWiki({ projectId, name, content, mailNotify, }), }; }; - src/tools/addWiki.ts:7-22 (schema)Input schema for add_wiki defining projectId (number), name (string), content (string), and optional mailNotify (boolean).
const addWikiSchema = buildToolSchema((t) => ({ projectId: z.number().describe(t('TOOL_ADD_WIKI_PROJECT_ID', 'Project ID')), name: z.string().describe(t('TOOL_ADD_WIKI_NAME', 'Name of the wiki page')), content: z .string() .describe(t('TOOL_ADD_WIKI_CONTENT', 'Content of the wiki page')), mailNotify: z .boolean() .optional() .describe( t( 'TOOL_ADD_WIKI_MAIL_NOTIFY', 'Whether to send notification emails (default: false)' ) ), })); - Output schema (WikiSchema) used by add_wiki tool, defining the wiki page response shape (id, projectId, name, content, tags, attachments, etc.).
export const WikiSchema = z.object({ id: z.number(), projectId: z.number(), name: z.string(), content: z.string(), tags: z.array(TagSchema), attachments: z.array(WikiFileInfoSchema), sharedFiles: z.array(SharedFileSchema), stars: z.array(StarSchema), createdUser: UserSchema, created: z.string(), updatedUser: UserSchema, updated: z.string(), }); - src/tools/tools.ts:125-135 (registration)Registration of add_wiki tool in the 'wiki' toolset group. addWikiTool(backlog, helper) is called to instantiate it.
{ name: 'wiki', description: 'Tools for managing wiki pages.', enabled: false, tools: [ getWikiPagesTool(backlog, helper), getWikisCountTool(backlog, helper), getWikiTool(backlog, helper), addWikiTool(backlog, helper), updateWikiTool(backlog, helper), ], - src/types/tool.ts:24-26 (helper)buildToolSchema helper function used to construct the input schema for add_wiki.
export const buildToolSchema = <T extends z.ZodRawShape>( fn: (t: TranslationHelper['t']) => T ) => fn;