Skip to main content
Glama
aliyun

AlibabaCloud DevOps MCP Server

Official
by aliyun

list_repositories

Retrieve and manage CodeUp repository lists from Alibaba Cloud DevOps platform to view and organize source code repositories by organization, with pagination, search, and sorting capabilities.

Instructions

[Code Management] Get the CodeUp Repository List.

A Repository serves as a unit for managing source code and is distinct from a Project.

Use Case:

View my repositories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationIdYesOrganization ID, can be found in the basic information page of the organization admin console
pageNoPage number, default starts from 1, generally should not exceed 150 pages
perPageNoItems per page, default 20, value range [1, 100]
orderByNoSort field, options include {created_at, name, path, last_activity_at}, default is created_atcreated_at
sortNoSort order, options include {asc, desc}, default is descdesc
searchNoSearch keyword, used to fuzzy match repository paths
archivedNoWhether archived

Implementation Reference

  • Tool handler for list_repositories: parses input schema, calls the core listRepositoriesFunc, and returns JSON stringified result.
    case "list_repositories": { const args = types.ListRepositoriesSchema.parse(request.params.arguments); const repositoryList = await repositories.listRepositoriesFunc( args.organizationId, args.page, args.perPage, args.orderBy, args.sort, args.search ?? undefined, args.archived ); return { content: [{ type: "text", text: JSON.stringify(repositoryList, null, 2) }], }; }
  • Core implementation of listRepositoriesFunc: builds API URL with query params, makes GET request to Yunxiao API, parses response with RepositorySchema.
    export async function listRepositoriesFunc( organizationId: string, page?: number, perPage?: number, orderBy?: string, sort?: string, search?: string, archived?: boolean ): Promise<z.infer<typeof RepositorySchema>[]> { const baseUrl = `/oapi/v1/codeup/organizations/${organizationId}/repositories`; const queryParams: Record<string, string | number | undefined> = {}; if (page !== undefined) { queryParams.page = page; } if (perPage !== undefined) { queryParams.perPage = perPage; } if (orderBy !== undefined) { queryParams.orderBy = orderBy; } if (sort !== undefined) { queryParams.sort = sort; } if (search !== undefined) { queryParams.search = search; } if (archived !== undefined) { queryParams.archived = String(archived); // Convert boolean to string } const url = buildUrl(baseUrl, queryParams); const response = await yunxiaoRequest(url, { method: "GET", }); if (!Array.isArray(response)) { return []; } return response.map(repo => RepositorySchema.parse(repo)); }
  • Zod schema definition for ListRepositories input validation, defining parameters like organizationId, pagination, sorting, search, and archived filter.
    export const ListRepositoriesSchema = z.object({ organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"), page: z.number().int().default(1).optional().describe("Page number, default starts from 1, generally should not exceed 150 pages"), perPage: z.number().int().default(20).optional().describe("Items per page, default 20, value range [1, 100]"), orderBy: z.string().default("created_at").optional().describe("Sort field, options include {created_at, name, path, last_activity_at}, default is created_at"), sort: z.string().default("desc").optional().describe("Sort order, options include {asc, desc}, default is desc"), search: z.string().nullable().optional().describe("Search keyword, used to fuzzy match repository paths"), archived: z.boolean().default(false).optional().describe("Whether archived"), });
  • Registers the list_repositories tool in the tool registry with name, description, and input schema derived from ListRepositoriesSchema.
    { name: "list_repositories", description: "[Code Management] Get the CodeUp Repository List.\n" + "\n" + "A Repository serves as a unit for managing source code and is distinct from a Project.\n" + "\n" + "Use Case:\n" + "\n" + "View my repositories", inputSchema: zodToJsonSchema(types.ListRepositoriesSchema), },

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/aliyun/alibabacloud-devops-mcp-server'

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