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) }], }; } );

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