Skip to main content
Glama

get_repository

Retrieve specific repository details from Azure DevOps by providing the project and repository IDs. This tool enables precise access to repository information through the Azure DevOps MCP Server.

Instructions

Get details of a specific repository

Input Schema

NameRequiredDescriptionDefault
projectIdYesThe ID or name of the project
repositoryIdYesThe ID or name of the repository

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "projectId": { "description": "The ID or name of the project", "type": "string" }, "repositoryId": { "description": "The ID or name of the repository", "type": "string" } }, "required": [ "projectId", "repositoryId" ], "type": "object" }

Implementation Reference

  • Core handler function that fetches the Git repository details from Azure DevOps using the Git API, with error handling for not found and other errors.
    export async function getRepository( connection: WebApi, projectId: string, repositoryId: string, ): Promise<GitRepository> { try { const gitApi = await connection.getGitApi(); const repository = await gitApi.getRepository(repositoryId, projectId); if (!repository) { throw new AzureDevOpsResourceNotFoundError( `Repository '${repositoryId}' not found in project '${projectId}'`, ); } return repository; } catch (error) { if (error instanceof AzureDevOpsError) { throw error; } throw new Error( `Failed to get repository: ${error instanceof Error ? error.message : String(error)}`, ); } }
  • Zod schema defining the input parameters for the get_repository tool: optional projectId, optional organizationId, required repositoryId.
    export const GetRepositorySchema = z.object({ projectId: z .string() .optional() .describe(`The ID or name of the project (Default: ${defaultProject})`), organizationId: z .string() .optional() .describe(`The ID or name of the organization (Default: ${defaultOrg})`), repositoryId: z.string().describe('The ID or name of the repository'), });
  • MCP tool definition registration including name, description, and input schema for 'get_repository'.
    name: 'get_repository', description: 'Get details of a specific repository', inputSchema: zodToJsonSchema(GetRepositorySchema), },
  • Tool dispatch handler case that parses arguments, calls the core getRepository function, and formats the JSON response.
    case 'get_repository': { const args = GetRepositorySchema.parse(request.params.arguments); const result = await getRepository( connection, args.projectId ?? defaultProject, args.repositoryId, ); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
  • Registration of 'get_repository' tool name in the repositories request identifier function.
    'get_repository',

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