get_wiki_page
Retrieve wiki page content from Azure DevOps by specifying wiki ID and page path to access project documentation.
Instructions
Get the content of a wiki page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organizationId | No | The ID or name of the organization (Default: mycompany) | |
| projectId | No | The ID or name of the project (Default: MyProject) | |
| wikiId | Yes | The ID or name of the wiki | |
| pagePath | Yes | The path of the page within the wiki |
Implementation Reference
- The core handler function that implements the logic to fetch and return the content of a specified wiki page using the Azure DevOps Wiki client.export async function getWikiPage( options: GetWikiPageOptions, ): Promise<string> { const { organizationId, projectId, wikiId, pagePath } = options; try { // Create the client const client = await azureDevOpsClient.getWikiClient({ organizationId, }); // Get the wiki page return (await client.getPage(projectId, wikiId, pagePath)).content; } catch (error) { // If it's already an AzureDevOpsError, rethrow it if (error instanceof AzureDevOpsError) { throw error; } // Otherwise wrap it in an AzureDevOpsError throw new AzureDevOpsError('Failed to get wiki page', { cause: error }); } }
- Zod schema defining the input parameters for the get_wiki_page tool, including organizationId, projectId, wikiId, and pagePath with descriptions and defaults.export const GetWikiPageSchema = z.object({ organizationId: z .string() .optional() .nullable() .describe(`The ID or name of the organization (Default: ${defaultOrg})`), projectId: z .string() .optional() .nullable() .describe(`The ID or name of the project (Default: ${defaultProject})`), wikiId: z.string().describe('The ID or name of the wiki'), pagePath: z.string().describe('The path of the page within the wiki'), });
- src/features/wikis/tool-definitions.ts:19-23 (registration)Registration of the get_wiki_page tool in the wikisTools array, specifying name, description, and input schema.{ name: 'get_wiki_page', description: 'Get the content of a wiki page', inputSchema: zodToJsonSchema(GetWikiPageSchema), },
- src/features/wikis/index.ts:69-80 (registration)Handler case in handleWikisRequest that parses arguments with the schema and invokes the getWikiPage function for the 'get_wiki_page' tool name.case 'get_wiki_page': { const args = GetWikiPageSchema.parse(request.params.arguments); const result = await getWikiPage({ organizationId: args.organizationId ?? defaultOrg, projectId: args.projectId ?? defaultProject, wikiId: args.wikiId, pagePath: args.pagePath, }); return { content: [{ type: 'text', text: result }], }; }