get_repository
Retrieve details about a Codeup repository from Alibaba Cloud DevOps platform by providing organization and repository identifiers for code management tasks.
Instructions
[Code Management] Get information about a Codeup repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organizationId | Yes | Organization ID, can be found in the basic information page of the organization admin console | |
| repositoryId | Yes | Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F) |
Implementation Reference
- tool-handlers/code-management.ts:157-166 (handler)Tool handler implementation that parses input arguments, calls the getRepositoryFunc helper, and formats the response as JSON text.case "get_repository": { const args = types.GetRepositorySchema.parse(request.params.arguments); const repository = await repositories.getRepositoryFunc( args.organizationId, args.repositoryId ); return { content: [{ type: "text", text: JSON.stringify(repository, null, 2) }], }; }
- operations/codeup/types.ts:248-251 (schema)Zod input schema for validating arguments to the get_repository tool: organizationId and repositoryId.export const GetRepositorySchema = z.object({ organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"), repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"), });
- tool-registry/code-management.ts:61-65 (registration)Tool registration defining the name, description, and input schema for get_repository.{ name: "get_repository", description: "[Code Management] Get information about a Codeup repository", inputSchema: zodToJsonSchema(types.GetRepositorySchema), },
- Core helper function that encodes repositoryId, constructs API URL, fetches data via yunxiaoRequest, and parses response with RepositorySchema.export async function getRepositoryFunc( organizationId: string, repositoryId: string ): Promise<z.infer<typeof RepositorySchema>> { const encodedRepoId = handleRepositoryIdEncoding(repositoryId); const url = `/oapi/v1/codeup/organizations/${organizationId}/repositories/${encodedRepoId}`; const response = await yunxiaoRequest(url, { method: "GET", }); return RepositorySchema.parse(response); }