get_wiki_page
Retrieve Azure DevOps wiki pages by specifying the wiki identifier and page path to access documentation or content stored in the wiki.
Instructions
Get a wiki page by path
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wikiIdentifier | Yes | Wiki identifier | |
| path | Yes | Page path | |
| version | No | Version (optional, defaults to main) | |
| includeContent | No | Include page content (optional, defaults to true) |
Implementation Reference
- src/tools/wiki/get.ts:29-73 (handler)The primary handler function implementing the get_wiki_page tool logic. It validates input arguments, initializes the Azure DevOps connection, fetches wiki information using WikiApi, and returns a formatted MCP response (noting current limitation on page content).export async function getWikiPage(args: GetWikiPageArgs, config: AzureDevOpsConfig) { if (!args.wikiIdentifier || !args.path) { throw new McpError( ErrorCode.InvalidParams, 'Wiki identifier and page path are required' ); } AzureDevOpsConnection.initialize(config); const connection = AzureDevOpsConnection.getInstance(); const wikiApi = await connection.getWikiApi(); try { // Get wiki information const wiki = await wikiApi.getWiki(config.project, args.wikiIdentifier); if (!wiki || !wiki.id) { throw new McpError( ErrorCode.InvalidParams, `Wiki ${args.wikiIdentifier} not found` ); } // For now, we can only return the wiki information since the page API is not available return { content: [ { type: 'text', text: JSON.stringify({ id: wiki.id, name: wiki.name, path: args.path, message: 'Wiki page content retrieval is not supported in the current API version' }, null, 2), }, ], }; } catch (error: unknown) { if (error instanceof McpError) throw error; const errorMessage = error instanceof Error ? error.message : 'Unknown error'; throw new McpError( ErrorCode.InternalError, `Failed to get wiki page: ${errorMessage}` ); } }
- src/tools/wiki/index.ts:17-40 (schema)The input schema definition for the get_wiki_page tool, specifying properties, descriptions, and required fields.name: 'get_wiki_page', description: 'Get a wiki page by path', inputSchema: { type: 'object', properties: { wikiIdentifier: { type: 'string', description: 'Wiki identifier', }, path: { type: 'string', description: 'Page path', }, version: { type: 'string', description: 'Version (optional, defaults to main)', }, includeContent: { type: 'boolean', description: 'Include page content (optional, defaults to true)', }, }, required: ['wikiIdentifier', 'path'], },
- src/tools/wiki/get.ts:5-10 (schema)TypeScript interface defining the arguments for the getWikiPage handler function.interface GetWikiPageArgs { wikiIdentifier: string; path: string; version?: string; includeContent?: boolean; }
- src/tools/wiki/index.ts:95-96 (registration)Wrapper function in wikiTools.initialize that binds the getWikiPage handler with config for tool invocation.getWikiPage: (args: { wikiIdentifier: string; path: string; version?: string; includeContent?: boolean }) => getWikiPage(args, config),
- src/index.ts:142-143 (registration)Dispatch logic in the main MCP server that routes 'get_wiki_page' tool calls to the wiki tools instance.case 'get_wiki_page': result = await tools.wiki.getWikiPage(request.params.arguments);