get-repositories
Retrieve repositories from an Azure DevOps project with optional links using the DevOps Enhanced MCP server. Automatically adapts to authentication context for multi-organization integration.
Instructions
Get repositories from Azure DevOps project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| includeLinks | No | Include repository links in response |
Input Schema (JSON Schema)
{
"properties": {
"includeLinks": {
"description": "Include repository links in response",
"type": "boolean"
}
},
"type": "object"
}
Implementation Reference
- src/handlers/tool-handlers.ts:915-941 (handler)The core handler function that executes the get-repositories tool logic. It makes an authenticated API request to the Azure DevOps '/git/repositories' endpoint, processes the response to extract key repository details, and returns a formatted JSON response.private async getRepositories(args: any): Promise<any> { try { const result = await this.makeApiRequest('/git/repositories?api-version=7.1'); const repositories = result.value.map((repo: any) => ({ id: repo.id, name: repo.name, url: repo.webUrl, defaultBranch: repo.defaultBranch, size: repo.size, ...(args.includeLinks && { links: repo._links }) })); return { content: [{ type: 'text', text: JSON.stringify({ count: repositories.length, repositories }, null, 2), }], }; } catch (error) { throw new Error(`Failed to get repositories: ${error instanceof Error ? error.message : 'Unknown error'}`); } }
- src/index.ts:229-241 (registration)Registers the 'get-repositories' tool with the MCP server in the listTools handler, providing the tool name, description, and input schema for validation.{ name: 'get-repositories', description: 'Get repositories from Azure DevOps project', inputSchema: { type: 'object', properties: { includeLinks: { type: 'boolean', description: 'Include repository links in response', }, }, }, },
- src/handlers/tool-handlers.ts:41-42 (handler)The switch case dispatcher in handleToolCall that routes 'get-repositories' tool calls to the specific getRepositories implementation method.case 'get-repositories': return await this.getRepositories(args || {});
- src/index.ts:232-240 (schema)The input schema definition for the get-repositories tool, specifying optional includeLinks parameter.inputSchema: { type: 'object', properties: { includeLinks: { type: 'boolean', description: 'Include repository links in response', }, }, },