Skip to main content
Glama
aliyun

AlibabaCloud DevOps MCP Server

Official
by aliyun

get_change_request

Retrieve details about a specific merge request in Alibaba Cloud DevOps repositories to track code changes and review status.

Instructions

[Code Management] Get information about a change request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationIdYesOrganization ID, can be found in the basic information page of the organization admin console
repositoryIdYesRepository 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)
localIdYesLocal ID, represents the nth merge request in the repository

Implementation Reference

  • MCP tool handler for 'get_change_request': parses arguments using the schema and calls the core getChangeRequestFunc implementation.
    case "get_change_request": {
      const args = types.GetChangeRequestSchema.parse(request.params.arguments);
      const changeRequest = await changeRequests.getChangeRequestFunc(
        args.organizationId,
        args.repositoryId,
        args.localId
      );
      return {
        content: [{ type: "text", text: JSON.stringify(changeRequest, null, 2) }],
      };
    }
  • Tool registration entry for 'get_change_request' including name, description, and input schema reference.
    {
      name: "get_change_request",
      description: "[Code Management] Get information about a change request",
      inputSchema: zodToJsonSchema(types.GetChangeRequestSchema),
    },
  • Zod input schema definition for validating arguments to the get_change_request tool.
    export const GetChangeRequestSchema = 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)"),
      localId: z.string().describe("Local ID, represents the nth merge request in the repository"),
    });
  • Core helper function that encodes the repository ID, constructs the API URL, fetches the change request data via yunxiaoRequest, and parses the response using ChangeRequestSchema.
    export async function getChangeRequestFunc(
      organizationId: string,
      repositoryId: string,
      localId: string
    ): Promise<z.infer<typeof ChangeRequestSchema>> {
      const encodedRepoId = handleRepositoryIdEncoding(repositoryId);
    
      const url = `/oapi/v1/codeup/organizations/${organizationId}/repositories/${encodedRepoId}/changeRequests/${localId}`;
    
      const response = await yunxiaoRequest(url, {
        method: "GET",
      });
    
      return ChangeRequestSchema.parse(response);
    }
  • Zod output schema (ChangeRequestSchema) used to parse and validate the API response for the change request data.
    export const ChangeRequestSchema = z.object({
      ahead: z.number().int().nullable().optional().describe("源分支领先目标分支的commit数量"),
      allRequirementsPass: z.boolean().nullable().optional().describe("是否所有卡点项通过"),
      author: z.object({
        avatar: z.string().nullable().optional().describe("用户头像地址"),
        email: z.string().nullable().optional().describe("用户邮箱"),
        name: z.string().nullable().optional().describe("用户名称"),
        state: z.string().nullable().optional().describe("用户状态:active - 激活可用;blocked - 阻塞暂不可用"),
        userId: z.string().nullable().optional().describe("云效用户ID"),
        username: z.string().nullable().optional().describe("用户登录名")
      }).nullable().optional().describe("创建者信息"),
      behind: z.number().int().nullable().optional().describe("目标分支领先源分支的commit数量"),
      canRevertOrCherryPick: z.boolean().nullable().optional().describe("是否能Revert或者CherryPick"),
      conflictCheckStatus: z.string().nullable().optional().describe("冲突检测状态:CHECKING - 检测中;HAS_CONFLICT - 有冲突;NO_CONFLICT - 无冲突;FAILED - 检测失败"),
      createFrom: z.string().nullable().optional().describe("创建来源:WEB - 页面创建;COMMAND_LINE - 命令行创建"),
      createTime: z.string().nullable().optional().describe("创建时间 (ISO 8601格式)"),
      description: z.string().nullable().optional().describe("描述"),
      detailUrl: z.string().nullable().optional().describe("合并请求详情地址"),
      hasReverted: z.boolean().nullable().optional().describe("是否Revert过"),
      localId: z.union([z.string(), z.number().int()]).nullable().optional().describe("局部ID,表示代码库中第几个合并请求"),
      mergedRevision: z.string().nullable().optional().describe("合并版本(提交ID),仅已合并状态才有值"),
      mrType: z.string().nullable().optional().describe("合并请求类型"),
      projectId: z.number().int().nullable().optional().describe("项目ID"),
      reviewers: z.array(z.object({
        avatar: z.string().nullable().optional().describe("用户头像地址"),
        email: z.string().nullable().optional().describe("用户邮箱"),
        hasCommented: z.boolean().nullable().optional().describe("是否已评论"),
        hasReviewed: z.boolean().nullable().optional().describe("是否已审阅"),
        name: z.string().nullable().optional().describe("用户名称"),
        reviewOpinionStatus: z.string().nullable().optional().describe("审阅意见状态"),
        reviewTime: z.string().nullable().optional().describe("审阅时间 (ISO 8601格式)"),
        state: z.string().nullable().optional().describe("用户状态"),
        userId: z.string().nullable().optional().describe("云效用户ID"),
        username: z.string().nullable().optional().describe("用户登录名")
      })).nullable().optional().describe("评审人列表"),
      sourceBranch: z.string().nullable().optional().describe("源分支"),
      sourceCommitId: z.string().nullable().optional().describe("源提交ID,当createFrom=COMMAND_LINE时有值"),
      sourceProjectId: z.union([z.string(), z.number().int()]).nullable().optional().describe("源库ID"),
      sourceRef: z.string().nullable().optional().describe("源提交引用,当createFrom=COMMAND_LINE时有值"),
      status: z.string().nullable().optional().describe("合并请求状态:UNDER_DEV - 开发中;UNDER_REVIEW - 评审中;TO_BE_MERGED - 待合并;CLOSED - 已关闭;MERGED - 已合并"),
      subscribers: z.array(z.object({
        avatar: z.string().nullable().optional().describe("用户头像地址"),
        email: z.string().nullable().optional().describe("用户邮箱"),
        name: z.string().nullable().optional().describe("用户名称"),
        state: z.string().nullable().optional().describe("用户状态"),
        userId: z.string().nullable().optional().describe("云效用户ID"),
        username: z.string().nullable().optional().describe("用户登录名")
      })).nullable().optional().describe("订阅人列表"),
      supportMergeFastForwardOnly: z.boolean().nullable().optional().describe("是否支持fast-forward-only"),
      targetBranch: z.string().nullable().optional().describe("目标分支"),
      targetProjectId: z.union([z.string(), z.number().int()]).nullable().optional().describe("目标库ID"),
      targetProjectNameWithNamespace: z.string().nullable().optional().describe("目标库名称(含完整父路径)"),
      targetProjectPathWithNamespace: z.string().nullable().optional().describe("目标库路径(含完整父路径)"),
      title: z.string().nullable().optional().describe("标题"),
      totalCommentCount: z.number().int().nullable().optional().describe("总评论数"),
      unResolvedCommentCount: z.number().int().nullable().optional().describe("未解决评论数"),
      updateTime: z.string().nullable().optional().describe("更新时间 (ISO 8601格式)"),
      webUrl: z.string().nullable().optional().describe("页面地址")
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a 'Get' operation which implies read-only behavior, but doesn't specify authentication requirements, rate limits, error conditions, or what happens when parameters are invalid. For a tool with 3 required parameters and no annotations, this leaves significant behavioral questions unanswered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - just one sentence with a domain prefix. While efficient, it may be too brief given the tool's complexity. The '[Code Management]' prefix provides helpful context upfront, and the single sentence states the core purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 3 required parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what information is returned about the change request, what format the response takes, or what distinguishes this from other change request-related tools. The description should provide more context about the tool's behavior and output given the lack of structured metadata.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds no additional parameter information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no parameter information in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Get information about a change request' which provides a basic verb+resource combination, but it's vague about what specific information is retrieved. It doesn't distinguish from sibling tools like 'get_change_request_comments' or 'list_change_requests' which might provide related information. The '[Code Management]' prefix adds some domain context but doesn't clarify the specific purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There are multiple sibling tools that might retrieve change request information (like 'list_change_requests', 'list_change_request_comments', 'list_change_request_patch_sets'), but the description doesn't explain when this specific 'get' operation is appropriate versus those list operations. No exclusions or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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