Skip to main content
Glama
nikydobrev

Azure DevOps Multi-Organization MCP Server

by nikydobrev

git_get_item

Retrieve files or folders from Azure DevOps Git repositories with version control, content options, and metadata for efficient repository management.

Instructions

Gets a file or folder from a Git repository with optional content and version control

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationYesThe name of the Azure DevOps organization
projectYesProject ID or name
repositoryIdYesThe repository ID or name
pathYesPath to the file or folder
scopePathNoScope path to filter items
recursionLevelNoRecursion level (None, OneLevel, Full, OneLevelPlusNestedEmptyFolders)
includeContentMetadataNoInclude content metadata
latestProcessedChangeNoInclude latest commit that changed this item
downloadNoSet Content-Disposition header for download
versionDescriptorNoVersion descriptor
includeContentNoInclude file content (text only)
resolveLfsNoResolve LFS pointer files to actual content
sanitizeNoSanitize HTML content

Implementation Reference

  • The handler function that executes the git_get_item tool logic by calling the Azure DevOps Git API's getItem method with the provided parameters, handling version descriptors and returning the item as JSON.
    async ({ organization, project, repositoryId, path, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveLfs, sanitize }) => {
      const connection = await connectionManager.getConnection(organization);
      const gitApi = await connection.getGitApi();
      
      let azVersionDescriptor: any = undefined;
      if (versionDescriptor) {
        azVersionDescriptor = {
          version: versionDescriptor.version,
          versionType: safeEnumConvert<GitVersionType>(GitVersionType, versionDescriptor.versionType)
        };
      }
    
      const item = await gitApi.getItem(
        repositoryId, 
        path, 
        project, 
        scopePath,
        recursionLevel as any,
        includeContentMetadata,
        latestProcessedChange,
        download,
        azVersionDescriptor,
        includeContent,
        resolveLfs,
        sanitize
      );
    
      return {
        content: [{ type: "text", text: JSON.stringify(item, null, 2) }],
      };
    }
  • Zod schema defining the input parameters for the git_get_item tool, including organization, project, repository, path, and various optional flags.
    {
      organization: z.string().describe("The name of the Azure DevOps organization"),
      project: z.string().describe("Project ID or name"),
      repositoryId: z.string().describe("The repository ID or name"),
      path: z.string().describe("Path to the file or folder"),
      scopePath: z.string().optional().describe("Scope path to filter items"),
      recursionLevel: z.string().optional().describe("Recursion level (None, OneLevel, Full, OneLevelPlusNestedEmptyFolders)"),
      includeContentMetadata: z.boolean().optional().describe("Include content metadata"),
      latestProcessedChange: z.boolean().optional().describe("Include latest commit that changed this item"),
      download: z.boolean().optional().describe("Set Content-Disposition header for download"),
      versionDescriptor: z.object({
        version: z.string().describe("Version string (branch name, commit SHA, tag)"),
        versionType: z.enum(getEnumKeys(GitVersionType)).describe("Type of version (Branch, Commit, Tag)"),
      }).optional().describe("Version descriptor"),
      includeContent: z.boolean().optional().describe("Include file content (text only)"),
      resolveLfs: z.boolean().optional().describe("Resolve LFS pointer files to actual content"),
      sanitize: z.boolean().optional().describe("Sanitize HTML content"),
    },
  • The server.tool call that registers the git_get_item tool with its name, description, input schema, and handler function.
    server.tool(
      "git_get_item",
      "Gets a file or folder from a Git repository with optional content and version control",
      {
        organization: z.string().describe("The name of the Azure DevOps organization"),
        project: z.string().describe("Project ID or name"),
        repositoryId: z.string().describe("The repository ID or name"),
        path: z.string().describe("Path to the file or folder"),
        scopePath: z.string().optional().describe("Scope path to filter items"),
        recursionLevel: z.string().optional().describe("Recursion level (None, OneLevel, Full, OneLevelPlusNestedEmptyFolders)"),
        includeContentMetadata: z.boolean().optional().describe("Include content metadata"),
        latestProcessedChange: z.boolean().optional().describe("Include latest commit that changed this item"),
        download: z.boolean().optional().describe("Set Content-Disposition header for download"),
        versionDescriptor: z.object({
          version: z.string().describe("Version string (branch name, commit SHA, tag)"),
          versionType: z.enum(getEnumKeys(GitVersionType)).describe("Type of version (Branch, Commit, Tag)"),
        }).optional().describe("Version descriptor"),
        includeContent: z.boolean().optional().describe("Include file content (text only)"),
        resolveLfs: z.boolean().optional().describe("Resolve LFS pointer files to actual content"),
        sanitize: z.boolean().optional().describe("Sanitize HTML content"),
      },
      async ({ organization, project, repositoryId, path, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveLfs, sanitize }) => {
        const connection = await connectionManager.getConnection(organization);
        const gitApi = await connection.getGitApi();
        
        let azVersionDescriptor: any = undefined;
        if (versionDescriptor) {
          azVersionDescriptor = {
            version: versionDescriptor.version,
            versionType: safeEnumConvert<GitVersionType>(GitVersionType, versionDescriptor.versionType)
          };
        }
    
        const item = await gitApi.getItem(
          repositoryId, 
          path, 
          project, 
          scopePath,
          recursionLevel as any,
          includeContentMetadata,
          latestProcessedChange,
          download,
          azVersionDescriptor,
          includeContent,
          resolveLfs,
          sanitize
        );
    
        return {
          content: [{ type: "text", text: JSON.stringify(item, null, 2) }],
        };
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'optional content and version control' which hints at read-only behavior and versioning capabilities, but fails to specify critical details: whether this is a read-only operation, what happens with large files or binary content, error conditions, rate limits, authentication requirements, or the format of returned data. For a tool with 13 parameters and no output schema, this leaves significant gaps in understanding how it behaves.

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

Conciseness5/5

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

The description is a single, efficient sentence that states the core purpose upfront. Every word earns its place: 'Gets' (action), 'a file or folder' (target), 'from a Git repository' (context), 'with optional content and version control' (key capabilities). There's no redundancy or unnecessary elaboration, making it easy for an agent to parse quickly.

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 (13 parameters, nested objects, no output schema, and no annotations), the description is insufficiently complete. It doesn't explain what the tool returns (file content, metadata, structure), how errors are handled, what authentication is required, or how the many optional parameters interact. For a tool that retrieves Git repository items with numerous configuration options, the description should provide more operational context to help an agent use it correctly.

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?

Schema description coverage is 100%, so the schema already documents all 13 parameters thoroughly. The description adds minimal value beyond the schema by mentioning 'optional content and version control' which loosely relates to includeContent, includeContentMetadata, latestProcessedChange, and versionDescriptor parameters. However, it doesn't provide additional context about parameter interactions, default behaviors, or practical usage examples that would help an agent understand how to combine these parameters effectively.

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 action ('Gets') and resource ('a file or folder from a Git repository') with additional context about optional content and version control. It distinguishes from siblings like git_get_pull_request or git_list_repositories by focusing on repository items rather than pull requests or repository lists. However, it doesn't explicitly differentiate from potential overlapping tools like pipelines_get_build_log which also retrieves content.

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. It mentions optional features but doesn't specify scenarios where this tool is preferred over siblings like git_get_pull_request for code retrieval or pipelines_get_build_log for build-related content. There's no mention of prerequisites or constraints beyond what's implied by the parameters.

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/nikydobrev/mcp-server-azure-devops-multi'

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