Skip to main content
Glama

list_wiki_pages

Retrieve a list of wiki pages from an Azure DevOps wiki to view available documentation content and structure.

Instructions

List pages within an Azure DevOps wiki

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationIdNoThe ID or name of the organization (Default: mycompany)
projectIdNoThe ID or name of the project (Default: MyProject)
wikiIdYesThe ID or name of the wiki

Implementation Reference

  • The core handler function implementing the list_wiki_pages tool logic. It retrieves wiki pages from Azure DevOps using the wiki client.
    export async function listWikiPages( options: ListWikiPagesOptions, ): Promise<WikiPageSummary[]> { const { organizationId, projectId, wikiId } = options; // Use defaults if not provided const orgId = organizationId || defaultOrg; const projId = projectId || defaultProject; try { // Create the client const client = await azureDevOpsClient.getWikiClient({ organizationId: orgId, }); // Get the wiki pages const pages = await client.listWikiPages(projId, wikiId); // Return the pages directly since the client interface now matches our requirements return pages.map((page) => ({ id: page.id, path: page.path, url: page.url, order: page.order, })); } 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 list wiki pages', { cause: error }); } }
  • Zod schema for input validation of the list_wiki_pages tool parameters.
    export const ListWikiPagesSchema = 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'), });
  • Tool definition object registering the list_wiki_pages tool with name, description, and schema.
    { name: 'list_wiki_pages', description: 'List pages within an Azure DevOps wiki', inputSchema: zodToJsonSchema(ListWikiPagesSchema), },
  • Switch case in the wikis request handler that dispatches to the listWikiPages function.
    case 'list_wiki_pages': { const args = ListWikiPagesSchema.parse(request.params.arguments); const result = await listWikiPages({ organizationId: args.organizationId ?? defaultOrg, projectId: args.projectId ?? defaultProject, wikiId: args.wikiId, }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
  • Interface and function signature for the wiki pages handler.
    export interface WikiPageSummary { id: number; path: string; url?: string; order?: number; } /** * List wiki pages from a wiki * * @param options Options for listing wiki pages * @returns Array of wiki page summaries * @throws {AzureDevOpsResourceNotFoundError} When the wiki is not found * @throws {AzureDevOpsPermissionError} When the user does not have permission to access the wiki * @throws {AzureDevOpsError} When an error occurs while fetching the wiki pages */ export async function listWikiPages( options: ListWikiPagesOptions, ): Promise<WikiPageSummary[]> { const { organizationId, projectId, wikiId } = options; // Use defaults if not provided const orgId = organizationId || defaultOrg; const projId = projectId || defaultProject; try { // Create the client const client = await azureDevOpsClient.getWikiClient({ organizationId: orgId, }); // Get the wiki pages const pages = await client.listWikiPages(projId, wikiId); // Return the pages directly since the client interface now matches our requirements return pages.map((page) => ({ id: page.id, path: page.path, url: page.url, order: page.order, })); } 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 list wiki pages', { cause: error }); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Tiberriver256/mcp-server-azure-devops'

If you have feedback or need assistance with the MCP directory API, please join our Discord server