get_wiki_pages
Search and retrieve wiki pages from a Backlog project by project ID, key, or keyword.
Instructions
Returns list of Wiki pages
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | No | The numeric ID of the project (e.g., 12345) | |
| projectKey | No | The key of the project (e.g., 'PROJECT') | |
| keyword | No | Keyword to search for in Wiki pages | |
| organization | No | Optional organization name. Use list_organizations to inspect available organizations. |
Implementation Reference
- src/tools/getWikiPages.ts:35-66 (handler)The handler function that executes the get_wiki_pages tool logic. It accepts optional projectId, projectKey, and keyword, resolves the project identifier using resolveIdOrKey, and calls backlog.getWikis() to fetch wiki pages.
export const getWikiPagesTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof getWikiPagesSchema>, (typeof WikiListItemSchema)['shape'] > => { return { name: 'get_wiki_pages', description: t( 'TOOL_GET_WIKI_PAGES_DESCRIPTION', 'Returns list of Wiki pages' ), schema: z.object(getWikiPagesSchema(t)), outputSchema: WikiListItemSchema, importantFields: ['projectId', 'name', 'tags'], handler: async ({ projectId, projectKey, keyword }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } return backlog.getWikis({ projectIdOrKey: result.value, keyword, }); }, }; }; - src/tools/getWikiPages.ts:8-33 (schema)Input schema for the get_wiki_pages tool, defining optional projectId (number), projectKey (string), and keyword (string) parameters.
const getWikiPagesSchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe( t( 'TOOL_GET_WIKI_PAGES_PROJECT_ID', 'The numeric ID of the project (e.g., 12345)' ) ), projectKey: z .string() .optional() .describe( t( 'TOOL_GET_WIKI_PAGES_PROJECT_KEY', "The key of the project (e.g., 'PROJECT')" ) ), keyword: z .string() .optional() .describe( t('TOOL_GET_WIKI_PAGES_KEYWORD', 'Keyword to search for in Wiki pages') ), })); - Output schema for get_wiki_pages, defining the shape of a wiki page list item (id, projectId, name, tags, created/updated user info).
export const WikiListItemSchema = z.object({ id: z.number(), projectId: z.number(), name: z.string(), tags: z.array(TagSchema), createdUser: UserSchema, created: z.string(), updatedUser: UserSchema, updated: z.string(), }); - src/tools/tools.ts:125-136 (registration)Registration of get_wiki_pages in the 'wiki' toolset group (currently disabled), where getWikiPagesTool is called with backlog and helper instances.
{ 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/utils/resolveIdOrKey.ts:51-55 (helper)Helper utility used by the handler to resolve either projectId or projectKey into a single value for the Backlog API call.
export const resolveIdOrKey = <E extends EntityName>( entity: E, values: { id?: number; key?: string }, t: TranslationHelper['t'] ): ResolveResult => resolveIdOrField(entity, 'key', values, t);