Skip to main content
Glama

list_repositories

Retrieve and organize repositories in a specified Azure DevOps project using the project ID, with an option to include reference links for detailed access.

Instructions

List repositories in a project

Input Schema

NameRequiredDescriptionDefault
includeLinksNoWhether to include reference links
projectIdYesThe ID or name of the project

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "includeLinks": { "description": "Whether to include reference links", "type": "boolean" }, "projectId": { "description": "The ID or name of the project", "type": "string" } }, "required": [ "projectId" ], "type": "object" }

Implementation Reference

  • The core handler function that executes the list_repositories tool logic by fetching repositories from Azure DevOps Git API using the provided project ID and optional includeLinks flag.
    export async function listRepositories( connection: WebApi, options: ListRepositoriesOptions, ): Promise<GitRepository[]> { try { const gitApi = await connection.getGitApi(); const repositories = await gitApi.getRepositories( options.projectId, options.includeLinks, ); return repositories; } catch (error) { if (error instanceof AzureDevOpsError) { throw error; } throw new Error( `Failed to list repositories: ${error instanceof Error ? error.message : String(error)}`, ); } }
  • Zod schema defining the input parameters for the list_repositories tool: optional projectId, organizationId, and includeLinks.
    export const ListRepositoriesSchema = 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})`), includeLinks: z .boolean() .optional() .describe('Whether to include reference links'), });
  • Registration of the list_repositories tool in the repositoriesTools array, including name, description, and converted JSON schema.
    { name: 'list_repositories', description: 'List repositories in a project', inputSchema: zodToJsonSchema(ListRepositoriesSchema), },
  • Handler switch case in handleRepositoriesRequest that parses arguments with ListRepositoriesSchema and calls the listRepositories handler function.
    case 'list_repositories': { const args = ListRepositoriesSchema.parse(request.params.arguments); const result = await listRepositories(connection, { ...args, projectId: args.projectId ?? defaultProject, }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], };
  • TypeScript interface defining the options parameter for the listRepositories handler function.
    export interface ListRepositoriesOptions { projectId: string; includeLinks?: boolean; }

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