Skip to main content
Glama
aliyun

AlibabaCloud DevOps MCP Server

Official
by aliyun

list_organization_roles

Retrieve available roles within an Alibaba Cloud DevOps organization to manage user permissions and access control for projects and resources.

Instructions

[Organization Management] List organization roles

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationIdYesOrganization ID

Implementation Reference

  • Tool handler implementation that parses input arguments using the schema, calls the listOrganizationRolesFunc helper, and returns the roles as a JSON string in the tool response format.
    case "list_organization_roles": {
      const args = types.ListOrganizationRolesSchema.parse(request.params.arguments);
      const roles = await organization.listOrganizationRolesFunc(args.organizationId);
      return {
        content: [{ type: "text", text: JSON.stringify(roles, null, 2)}]
      }
    }
  • Tool registration entry defining the name, description, and input schema for the list_organization_roles tool.
    {
      name: "list_organization_roles",
      description: "[Organization Management] List organization roles",
      inputSchema: zodToJsonSchema(types.ListOrganizationRolesSchema),
    },
  • Zod schema definition for the input parameters of the list_organization_roles tool, requiring organizationId.
    export const ListOrganizationRolesSchema = z.object({
      organizationId: z.string().describe("Organization ID")
    });
  • Core helper function that makes the API request to fetch organization roles and parses the response using the OrganizationRole schema.
    export async function listOrganizationRolesFunc(
        organizationId: string
    ): Promise<z.infer<typeof OrganizationRole>> {
        const url = `/oapi/v1/platform/organizations/${organizationId}/roles`;
    
        const response = await yunxiaoRequest(url, {
            method: "GET"
        });
    
        return OrganizationRole.parse(response);
    }
  • Zod schema definitions for the organization role objects and the array of roles used for output validation in the helper function.
    export const OrganizationRoleSchema = z.object({
      id: z.string().describe("Role ID"),
      name: z.string().describe("Role name"),
      organizationId: z.string().describe("Organization ID"),
      permissions: z.array(z.string()).describe("Role permission list")
    });
    
    export const OrganizationRole = z.array(OrganizationRoleSchema);

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