Skip to main content
Glama
aliyun

AlibabaCloud DevOps MCP Server

Official
by aliyun

list_change_request_patch_sets

Retrieve patch sets for a specific change request in Alibaba Cloud DevOps to track code modifications and review updates during development.

Instructions

[Code Management] List patch sets for 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: parses arguments with ListChangeRequestPatchSetsSchema, calls listChangeRequestPatchSetsFunc, returns JSON stringified patch sets.
    case "list_change_request_patch_sets": {
      const args = types.ListChangeRequestPatchSetsSchema.parse(request.params.arguments);
      const patchSets = await changeRequests.listChangeRequestPatchSetsFunc(
        args.organizationId,
        args.repositoryId,
        args.localId
      );
    
      return {
        content: [{ type: "text", text: JSON.stringify(patchSets, null, 2) }],
      };
    }
  • Core implementation: encodes repository ID, calls API /changeRequests/{localId}/diffs/patches, parses response array with PatchSetSchema.
    export async function listChangeRequestPatchSetsFunc(
      organizationId: string,
      repositoryId: string,
      localId: string
    ): Promise<z.infer<typeof PatchSetSchema>[]> {
      const encodedRepoId = handleRepositoryIdEncoding(repositoryId);
    
      const url = `/oapi/v1/codeup/organizations/${organizationId}/repositories/${encodedRepoId}/changeRequests/${localId}/diffs/patches`;
    
      const response = await yunxiaoRequest(url, {
        method: "GET",
      });
    
      // 确保响应是数组
      if (!Array.isArray(response)) {
        return [];
      }
    
      // 解析每个版本对象
      return response.map(patchSet => PatchSetSchema.parse(patchSet));
    }
  • Tool registration: defines name, description, and converts Zod input schema to JSON schema.
    {
      name: "list_change_request_patch_sets",
      description: "[Code Management] List patch sets for a change request",
      inputSchema: zodToJsonSchema(types.ListChangeRequestPatchSetsSchema),
    },
  • Input schema definition using Zod: requires organizationId, repositoryId, localId with descriptions.
    export const ListChangeRequestPatchSetsSchema = 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"),
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states it's a list operation, implying read-only behavior, but doesn't disclose any behavioral traits like pagination, rate limits, authentication needs, or what the output format looks like.

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—a single, front-loaded sentence with no wasted words. It efficiently conveys the core purpose without unnecessary details.

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?

Given the complexity (a list operation with three required parameters), no annotations, and no output schema, the description is incomplete. It lacks behavioral context, output details, and usage guidance, making it inadequate for an agent to use effectively without additional assumptions.

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 fully documents the three required parameters. The description doesn't add any meaning beyond the schema, such as explaining relationships between parameters or usage examples.

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 action ('List') and resource ('patch sets for a change request'), with a domain context hint ('[Code Management]'). It distinguishes from siblings like 'list_change_requests' by focusing on patch sets, though it doesn't explicitly contrast them.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a valid change request) or compare to other list tools like 'list_change_requests' or 'list_commits'.

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