wiki_list_wikis
Retrieve a list of wikis for Azure DevOps organizations or specific projects using PAT authentication. Simplify wiki management by filtering results by project name or ID.
Instructions
Retrieve a list of wikis for an organization or project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | No | The project name or ID to filter wikis. If not provided, all wikis in the organization will be returned. |
Implementation Reference
- src/tools/wiki.ts:56-76 (handler)The core handler logic for the "wiki_list_wikis" tool. It uses the Azure DevOps WikiApi to fetch all wikis for the given project (or organization-wide if no project specified), and returns the JSON serialized list or an error message.async ({ project }) => { try { const connection = await connectionProvider(); const wikiApi = await connection.getWikiApi(); const wikis = await wikiApi.getAllWikis(project); if (!wikis) { return { content: [{ type: "text", text: "No wikis found" }], isError: true }; } return { content: [{ type: "text", text: JSON.stringify(wikis, null, 2) }], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : "Unknown error occurred"; return { content: [{ type: "text", text: `Error fetching wikis: ${errorMessage}` }], isError: true, }; }
- src/tools/wiki.ts:53-55 (schema)Input schema definition for the tool using Zod, with optional 'project' parameter.{ project: z.string().optional().describe("The project name or ID to filter wikis. If not provided, all wikis in the organization will be returned."), },
- src/tools/wiki.ts:50-77 (registration)Direct registration of the "wiki_list_wikis" tool on the McpServer instance within configureWikiTools.server.tool( WIKI_TOOLS.list_wikis, "Retrieve a list of wikis for an organization or project.", { project: z.string().optional().describe("The project name or ID to filter wikis. If not provided, all wikis in the organization will be returned."), }, async ({ project }) => { try { const connection = await connectionProvider(); const wikiApi = await connection.getWikiApi(); const wikis = await wikiApi.getAllWikis(project); if (!wikis) { return { content: [{ type: "text", text: "No wikis found" }], isError: true }; } return { content: [{ type: "text", text: JSON.stringify(wikis, null, 2) }], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : "Unknown error occurred"; return { content: [{ type: "text", text: `Error fetching wikis: ${errorMessage}` }], isError: true, }; } }
- src/tools/wiki.ts:11-11 (helper)Constant mapping internal name to tool name string "wiki_list_wikis" in WIKI_TOOLS object.list_wikis: "wiki_list_wikis",
- src/tools.ts:26-26 (registration)Invocation of configureWikiTools in configureAllTools, which registers the wiki tools including "wiki_list_wikis".configureWikiTools(server, tokenProvider, connectionProvider);