Skip to main content
Glama
aliyun

AlibabaCloud DevOps MCP Server

Official
by aliyun

list_change_request_comments

Retrieve comments on Alibaba Cloud DevOps change requests to review feedback, track discussions, and manage code review processes effectively.

Instructions

[Code Management] List comments on 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)
localIdYesChange request local ID
patchSetBizIdsNoAssociated version ID list, each comment is associated with a version, indicating which version the comment was posted on, for global comments, it's associated with the latest merge source version
commentTypeNoComment type. Possible values: GLOBAL_COMMENT, INLINE_COMMENTGLOBAL_COMMENT
stateNoComment state. Possible values: OPENED, DRAFTOPENED
resolvedNoWhether marked as resolved
filePathNoFilter by file path (for inline comments)

Implementation Reference

  • Handler implementation that parses input arguments using the schema, calls the core listChangeRequestCommentsFunc helper, and returns the comments as JSON text.
    case "list_change_request_comments": {
      const args = types.ListChangeRequestCommentsSchema.parse(request.params.arguments);
      const comments = await changeRequestComments.listChangeRequestCommentsFunc(
        args.organizationId,
        args.repositoryId,
        args.localId,
        args.patchSetBizIds ?? undefined,
        args.commentType,
        args.state,
        args.resolved,
        args.filePath ?? undefined
      );
      return {
        content: [{ type: "text", text: JSON.stringify(comments, null, 2) }],
      };
    }
  • Tool registration in the code-management tools array, specifying name, description, and input schema.
      name: "list_change_request_comments",
      description: "[Code Management] List comments on a change request",
      inputSchema: zodToJsonSchema(types.ListChangeRequestCommentsSchema),
    },
  • Zod schema definition for the tool's input parameters, including organizationId, repositoryId, localId, and optional filters.
    export const ListChangeRequestCommentsSchema = 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("Change request local ID"),
      patchSetBizIds: z.array(z.string()).nullable().optional().describe("Associated version ID list, each comment is associated with a version, indicating which version the comment was posted on, for global comments, it's associated with the latest merge source version"),
      commentType: z.string().optional().default("GLOBAL_COMMENT").describe("Comment type. Possible values: GLOBAL_COMMENT, INLINE_COMMENT"),
      state: z.string().optional().default("OPENED").describe("Comment state. Possible values: OPENED, DRAFT"),
      resolved: z.boolean().optional().default(false).describe("Whether marked as resolved"),
      filePath: z.string().nullable().optional().describe("Filter by file path (for inline comments)"),
    });
  • Core helper function that performs the actual API call to list change request comments using yunxiaoRequest, parses the response with ChangeRequestCommentSchema.
    export async function listChangeRequestCommentsFunc(
      organizationId: string,
      repositoryId: string,
      localId: string,
      patchSetBizIds?: string[],
      commentType: string = "GLOBAL_COMMENT", // Possible values: GLOBAL_COMMENT, INLINE_COMMENT
      state: string = "OPENED", // Possible values: OPENED, DRAFT
      resolved: boolean = false,
      filePath?: string
    ): Promise<z.infer<typeof ChangeRequestCommentSchema>[]> {
      const encodedRepoId = handleRepositoryIdEncoding(repositoryId);
    
      const url = `/oapi/v1/codeup/organizations/${organizationId}/repositories/${encodedRepoId}/changeRequests/${localId}/comments/list`;
    
      // 准备payload
      const payload: Record<string, any> = {
        patchSetBizIds: patchSetBizIds || [],
        commentType: commentType,
        state: state,
        resolved: resolved,
      };
    
      // 添加可选参数
      if (filePath) {
        payload.filePath = filePath;
      }
    
      const response = await yunxiaoRequest(url, {
        method: "POST",
        body: payload,
      });
    
      // 确保响应是数组
      if (!Array.isArray(response)) {
        return [];
      }
    
      // 解析每个评论对象
      return response.map(comment => ChangeRequestCommentSchema.parse(comment));
    } 
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 list operation, implying it's likely read-only and non-destructive, but doesn't confirm this explicitly. It doesn't mention authentication requirements, rate limits, pagination behavior, or what the output looks like (though there's no output schema). For a tool with 8 parameters and no annotations, this leaves significant behavioral gaps.

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

Conciseness5/5

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

The description is extremely concise (one sentence) and front-loaded with the core purpose. Every word earns its place, with no redundant information. The bracketed '[Code Management]' context is efficiently placed at the beginning.

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 8 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't address behavioral aspects like authentication, rate limits, or output format. While the schema covers parameter definitions, the description doesn't provide the contextual information needed to use this tool effectively, especially given the complexity of filtering options.

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?

The description adds no parameter information beyond what's already in the schema (which has 100% coverage). It doesn't explain relationships between parameters (e.g., that 'filePath' only applies when 'commentType' is 'INLINE_COMMENT') or provide usage examples. With complete schema coverage, the baseline is 3, but the description doesn't enhance understanding of the parameters.

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

Purpose4/5

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

The description clearly states the verb ('List') and resource ('comments on a change request'), making the purpose immediately understandable. It distinguishes this tool from siblings like 'create_change_request_comment' or 'list_work_item_comments' by specifying the target resource type (change request comments). However, it doesn't explicitly differentiate from other list tools like 'list_change_requests' beyond the resource name.

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. It doesn't mention prerequisites (e.g., needing a specific change request), when filtering might be appropriate, or how this differs from other comment-listing tools like 'list_work_item_comments'. The agent must infer usage from the tool name alone.

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