Skip to main content
Glama
aliyun

AlibabaCloud DevOps MCP Server

Official
by aliyun

get_commit

Retrieve detailed information about a specific commit in Alibaba Cloud DevOps repositories using organization ID, repository ID, and commit SHA values.

Instructions

[Code Management] Get information about a commit

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationIdYes组织ID
repositoryIdYes代码库ID或者URL-Encoder编码的全路径
shaYes提交ID,即Commit SHA值

Implementation Reference

  • Registration of the 'get_commit' tool in the commit tools array, including name, description, and input schema.
    {
      name: 'get_commit',
      description: '[Code Management] Get information about a commit',
      inputSchema: zodToJsonSchema(GetCommitRequestSchema),
    },
  • Handler case in handleCommitTools that parses arguments, calls getCommit, and formats the response for the 'get_commit' tool.
    case 'get_commit':
      const getCommitParams = GetCommitRequestSchema.parse(request.params.arguments);
      const getCommitResult = await getCommit(getCommitParams);
      return {
        content: [{ type: "text", text: JSON.stringify(getCommitResult, null, 2) }],
      };
  • Core implementation of getCommit: constructs API URL and fetches commit details using yunxiaoRequest.
    export async function getCommit(params: z.infer<typeof GetCommitRequestSchema>) {
      const { organizationId, repositoryId, sha } = params;
      
      const encodedRepoId = handleRepositoryIdEncoding(repositoryId);
    
      const url = `/oapi/v1/codeup/organizations/${organizationId}/repositories/${encodedRepoId}/commits/${sha}`;
    
      const response: any = await yunxiaoRequest(url, {
        method: "GET",
      });
    
      return DevopsCommitVOSchemaType.parse(response);
    }
  • Zod schema defining input parameters for get_commit: organizationId, repositoryId, sha.
    export const GetCommitRequestSchema = z.object({
      organizationId: z.string().describe("组织ID"),
      repositoryId: z.string().describe("代码库ID或者URL-Encoder编码的全路径"),
      sha: z.string().describe("提交ID,即Commit SHA值"),
    });

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