wiki_get_wiki
Retrieve wiki content by specifying a unique identifier and project name or ID using the Azure DevOps MCP Server with PAT Authentication.
Instructions
Get the wiki by wikiIdentifier
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | No | The project name or ID where the wiki is located. If not provided, the default project will be used. | |
| wikiIdentifier | Yes | The unique identifier of the wiki. |
Implementation Reference
- src/tools/wiki.ts:26-47 (handler)The handler function that executes the logic for the wiki_get_wiki tool. It uses the Azure DevOps Wiki API to retrieve wiki details by wikiIdentifier and optional project, returning JSON or error message.async ({ wikiIdentifier, project }) => { try { const connection = await connectionProvider(); const wikiApi = await connection.getWikiApi(); const wiki = await wikiApi.getWiki(wikiIdentifier, project); if (!wiki) { return { content: [{ type: "text", text: "No wiki found" }], isError: true }; } return { content: [{ type: "text", text: JSON.stringify(wiki, null, 2) }], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : "Unknown error occurred"; return { content: [{ type: "text", text: `Error fetching wiki: ${errorMessage}` }], isError: true, }; } }
- src/tools/wiki.ts:22-25 (schema)Zod input schema defining parameters for the wiki_get_wiki tool: required wikiIdentifier (string) and optional project (string).{ wikiIdentifier: z.string().describe("The unique identifier of the wiki."), project: z.string().optional().describe("The project name or ID where the wiki is located. If not provided, the default project will be used."), },
- src/tools/wiki.ts:19-48 (registration)MCP server tool registration for 'wiki_get_wiki', specifying name, description, input schema, and handler function within configureWikiTools.server.tool( WIKI_TOOLS.get_wiki, "Get the wiki by wikiIdentifier", { wikiIdentifier: z.string().describe("The unique identifier of the wiki."), project: z.string().optional().describe("The project name or ID where the wiki is located. If not provided, the default project will be used."), }, async ({ wikiIdentifier, project }) => { try { const connection = await connectionProvider(); const wikiApi = await connection.getWikiApi(); const wiki = await wikiApi.getWiki(wikiIdentifier, project); if (!wiki) { return { content: [{ type: "text", text: "No wiki found" }], isError: true }; } return { content: [{ type: "text", text: JSON.stringify(wiki, null, 2) }], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : "Unknown error occurred"; return { content: [{ type: "text", text: `Error fetching wiki: ${errorMessage}` }], isError: true, }; } } );
- src/tools/wiki.ts:10-16 (helper)Constant object defining string constants for wiki-related tool names, including 'wiki_get_wiki'.const WIKI_TOOLS = { list_wikis: "wiki_list_wikis", get_wiki: "wiki_get_wiki", list_wiki_pages: "wiki_list_pages", get_wiki_page_content: "wiki_get_page_content", create_or_update_page: "wiki_create_or_update_page", };