list_wiki
Retrieve all wikis within an Azure DevOps project to manage content, search pages, and navigate hierarchical structures for efficient project documentation.
Instructions
List all wikis in a project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organization | No | Azure DevOps organization name | |
| project | No | Project name |
Input Schema (JSON Schema)
{
"properties": {
"organization": {
"description": "Azure DevOps organization name",
"type": "string"
},
"project": {
"description": "Project name",
"type": "string"
}
},
"required": [],
"type": "object"
}
Implementation Reference
- src/server.ts:312-333 (handler)Main tool handler for 'list_wiki' that validates input, initializes client, calls listWikis, and returns JSON response.private async handleListWiki(args: any) { const request = WikiListRequestSchema.parse(args); const organization = request.organization || this.config.defaultOrganization; const project = request.project || this.config.defaultProject; if (!organization) { throw new Error('Organization is required either as parameter or in server configuration'); } if (!project) { throw new Error('Project is required either as parameter or in server configuration'); } const client = await this.getClient(organization, project); const wikis = await client.listWikis(request); return { content: [{ type: 'text', text: JSON.stringify(wikis, null, 2) }] }; }
- src/server.ts:139-155 (registration)Tool registration including name, description, and input JSON schema.name: 'list_wiki', description: 'List all wikis in a project', inputSchema: { type: 'object', properties: { organization: { type: 'string', description: 'Azure DevOps organization name' }, project: { type: 'string', description: 'Project name' } }, required: [] } }
- src/types.ts:32-35 (schema)Zod schema for input validation of list_wiki tool parameters.export const WikiListRequestSchema = z.object({ organization: z.string().min(1).optional(), project: z.string().min(1).optional(), });
- src/azure-client.ts:397-429 (helper)Helper method in Azure client that calls Azure DevOps API to list wikis and maps to WikiInfo array.async listWikis(request: WikiListRequest): Promise<WikiInfo[]> { if (!this.wikiApi || !this.connection) { throw new Error('Azure DevOps client not initialized'); } try { const organization = request.organization || this.config.organization; const project = request.project || this.config.project; if (!organization || !project) { throw new Error('Organization and project must be provided'); } const wikis = await this.wikiApi.getAllWikis(project); if (!wikis || !Array.isArray(wikis)) { return []; } return wikis.map(wiki => ({ id: wiki.id || '', name: wiki.name || '', type: wiki.type?.toString() || '', url: wiki.url || '', project: project, repositoryId: wiki.repositoryId || '', mappedPath: wiki.mappedPath || '' })); } catch (error) { throw new Error(`Failed to list wikis: ${error instanceof Error ? error.message : String(error)}`); } }
- src/types.ts:82-89 (schema)Type definition for the output WikiInfo returned by listWikis.export interface WikiInfo { id: string; name: string; type: string; url: string; project: string; repositoryId: string; mappedPath: string;