wiki_list_pages
Retrieve a list of wiki pages for a specific project and wiki in Azure DevOps. Supports pagination, customizable page limits, and optional page view statistics.
Instructions
Retrieve a list of wiki pages for a specific wiki and project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| continuationToken | No | Token for pagination to retrieve the next set of pages. | |
| pageViewsForDays | No | Number of days to retrieve page views for. If not specified, page views are not included. | |
| project | Yes | The project name or ID where the wiki is located. | |
| top | No | The maximum number of pages to return. Defaults to 20. | |
| wikiIdentifier | Yes | The unique identifier of the wiki. |
Implementation Reference
- src/tools/wiki.ts:90-117 (handler)The core handler function that implements the wiki_list_pages tool logic by fetching a batch of wiki pages from the Azure DevOps Wiki API using getPagesBatch.async ({ wikiIdentifier, project, top = 20, continuationToken, pageViewsForDays }) => { try { const connection = await connectionProvider(); const wikiApi = await connection.getWikiApi(); const pagesBatchRequest: WikiPagesBatchRequest = { top, continuationToken, pageViewsForDays, }; const pages = await wikiApi.getPagesBatch(pagesBatchRequest, project, wikiIdentifier); if (!pages) { return { content: [{ type: "text", text: "No wiki pages found" }], isError: true }; } return { content: [{ type: "text", text: JSON.stringify(pages, null, 2) }], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : "Unknown error occurred"; return { content: [{ type: "text", text: `Error fetching wiki pages: ${errorMessage}` }], isError: true, }; }
- src/tools/wiki.ts:83-89 (schema)Zod input schema defining parameters for the wiki_list_pages tool: wikiIdentifier (required), project (required), top, continuationToken, pageViewsForDays.{ wikiIdentifier: z.string().describe("The unique identifier of the wiki."), project: z.string().describe("The project name or ID where the wiki is located."), top: z.number().default(20).describe("The maximum number of pages to return. Defaults to 20."), continuationToken: z.string().optional().describe("Token for pagination to retrieve the next set of pages."), pageViewsForDays: z.number().optional().describe("Number of days to retrieve page views for. If not specified, page views are not included."), },
- src/tools/wiki.ts:80-119 (registration)Direct registration of the wiki_list_pages tool on the MCP server using server.tool(), referencing the name from WIKI_TOOLS.server.tool( WIKI_TOOLS.list_wiki_pages, "Retrieve a list of wiki pages for a specific wiki and project.", { wikiIdentifier: z.string().describe("The unique identifier of the wiki."), project: z.string().describe("The project name or ID where the wiki is located."), top: z.number().default(20).describe("The maximum number of pages to return. Defaults to 20."), continuationToken: z.string().optional().describe("Token for pagination to retrieve the next set of pages."), pageViewsForDays: z.number().optional().describe("Number of days to retrieve page views for. If not specified, page views are not included."), }, async ({ wikiIdentifier, project, top = 20, continuationToken, pageViewsForDays }) => { try { const connection = await connectionProvider(); const wikiApi = await connection.getWikiApi(); const pagesBatchRequest: WikiPagesBatchRequest = { top, continuationToken, pageViewsForDays, }; const pages = await wikiApi.getPagesBatch(pagesBatchRequest, project, wikiIdentifier); if (!pages) { return { content: [{ type: "text", text: "No wiki pages found" }], isError: true }; } return { content: [{ type: "text", text: JSON.stringify(pages, null, 2) }], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : "Unknown error occurred"; return { content: [{ type: "text", text: `Error fetching wiki pages: ${errorMessage}` }], isError: true, }; } } );
- src/tools/wiki.ts:13-13 (helper)Constant mapping internal name to tool identifier string 'wiki_list_pages'.list_wiki_pages: "wiki_list_pages",
- src/tools.ts:26-26 (registration)Top-level call to configureWikiTools function, which registers the wiki_list_pages tool (and other wiki tools).configureWikiTools(server, tokenProvider, connectionProvider);