Skip to main content
Glama
Tiberriver256

Azure DevOps MCP Server

get_repository_details

Retrieve comprehensive repository information including statistics and refs from Azure DevOps projects to analyze codebase details and track development progress.

Instructions

Get detailed information about a repository including statistics and refs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdNoThe ID or name of the project (Default: MyProject)
organizationIdNoThe ID or name of the organization (Default: mycompany)
repositoryIdYesThe ID or name of the repository
includeStatisticsNoWhether to include branch statistics
includeRefsNoWhether to include repository refs
refFilterNoOptional filter for refs (e.g., "heads/" or "tags/")
branchNameNoName of specific branch to get statistics for (if includeStatistics is true)

Implementation Reference

  • The core handler function implementing the get_repository_details tool. Fetches repository details from Azure DevOps Git API, optionally including branch statistics and refs.
    export async function getRepositoryDetails(
      connection: WebApi,
      options: GetRepositoryDetailsOptions,
    ): Promise<RepositoryDetails> {
      try {
        const gitApi = await connection.getGitApi();
    
        // Get the basic repository information
        const repository = await gitApi.getRepository(
          options.repositoryId,
          options.projectId,
        );
    
        if (!repository) {
          throw new AzureDevOpsResourceNotFoundError(
            `Repository '${options.repositoryId}' not found in project '${options.projectId}'`,
          );
        }
    
        // Initialize the response object
        const response: RepositoryDetails = {
          repository,
        };
    
        // Get branch statistics if requested
        if (options.includeStatistics) {
          let baseVersionDescriptor = undefined;
    
          // If a specific branch name is provided, create a version descriptor for it
          if (options.branchName) {
            baseVersionDescriptor = {
              version: options.branchName,
              versionType: GitVersionType.Branch,
            };
          }
    
          const branchStats = await gitApi.getBranches(
            repository.id || '',
            options.projectId,
            baseVersionDescriptor,
          );
    
          response.statistics = {
            branches: branchStats || [],
          };
        }
    
        // Get repository refs if requested
        if (options.includeRefs) {
          const filter = options.refFilter || undefined;
          const refs = await gitApi.getRefs(
            repository.id || '',
            options.projectId,
            filter,
          );
    
          if (refs) {
            response.refs = {
              value: refs,
              count: refs.length,
            };
          } else {
            response.refs = {
              value: [],
              count: 0,
            };
          }
        }
    
        return response;
      } catch (error) {
        if (error instanceof AzureDevOpsError) {
          throw error;
        }
        throw new Error(
          `Failed to get repository details: ${error instanceof Error ? error.message : String(error)}`,
        );
      }
    }
  • Zod schema defining the input parameters for the get_repository_details tool.
    export const GetRepositoryDetailsSchema = 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'),
      includeStatistics: z
        .boolean()
        .optional()
        .default(false)
        .describe('Whether to include branch statistics'),
      includeRefs: z
        .boolean()
        .optional()
        .default(false)
        .describe('Whether to include repository refs'),
      refFilter: z
        .string()
        .optional()
        .describe('Optional filter for refs (e.g., "heads/" or "tags/")'),
      branchName: z
        .string()
        .optional()
        .describe(
          'Name of specific branch to get statistics for (if includeStatistics is true)',
        ),
    });
  • Tool definition registration including name, description, and input schema for get_repository_details.
      name: 'get_repository_details',
      description:
        'Get detailed information about a repository including statistics and refs',
      inputSchema: zodToJsonSchema(GetRepositoryDetailsSchema),
    },
  • Request handler switch case that parses arguments and invokes the getRepositoryDetails handler for 'get_repository_details' tool calls.
    case 'get_repository_details': {
      const args = GetRepositoryDetailsSchema.parse(request.params.arguments);
      const result = await getRepositoryDetails(connection, {
        projectId: args.projectId ?? defaultProject,
        repositoryId: args.repositoryId,
        includeStatistics: args.includeStatistics,
        includeRefs: args.includeRefs,
        refFilter: args.refFilter,
        branchName: args.branchName,
      });
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • TypeScript interfaces for input options and output response of the get_repository_details tool.
    export interface GetRepositoryDetailsOptions {
      projectId: string;
      repositoryId: string;
      includeStatistics?: boolean;
      includeRefs?: boolean;
      refFilter?: string;
      branchName?: string;
    }
    
    /**
     * Repository details response
     */
    export interface RepositoryDetails {
      repository: GitRepository;
      statistics?: {
        branches: GitBranchStats[];
      };
      refs?: {
        value: GitRef[];
        count: number;
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Get' implies a read-only operation, the description doesn't clarify authentication requirements, rate limits, error conditions, or response format. It mentions 'detailed information' but doesn't specify what that includes beyond 'statistics and refs,' leaving gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that clearly states the tool's purpose. It's appropriately sized for a read operation with a well-documented schema. There's no unnecessary verbiage, and it's front-loaded with the core functionality. However, it could be slightly more structured by explicitly mentioning key parameters or differentiating from siblings.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (7 parameters, no output schema, no annotations), the description is insufficient. It doesn't explain what 'detailed information' includes beyond statistics and refs, how the output is structured, or any behavioral constraints. For a tool with multiple optional parameters and no output schema, more context is needed to understand the full scope and limitations of the operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so parameters are well-documented in the schema itself. The description adds minimal value beyond the schema by mentioning 'statistics and refs,' which aligns with the 'includeStatistics' and 'includeRefs' parameters. However, it doesn't provide additional context about parameter interactions or usage patterns beyond what's already in the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get detailed information about a repository including statistics and refs.' It specifies the verb ('Get'), resource ('repository'), and scope of information ('statistics and refs'). However, it doesn't explicitly differentiate from sibling tools like 'get_repository' or 'get_repository_tree,' which might offer different levels or types of repository information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'get_repository,' 'get_repository_tree,' and 'get_all_repositories_tree,' there's no indication of how this tool differs in scope or depth. The description implies it provides 'detailed information,' but doesn't specify what makes it more detailed than other repository-related tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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