Skip to main content
Glama
aliyun

AlibabaCloud DevOps MCP Server

Official
by aliyun

get_user_organizations

Retrieve the list of organizations a user belongs to within Alibaba Cloud DevOps for managing projects, repositories, and workflows.

Instructions

Get the list of organizations the current user belongs to

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The switch case handler for the 'get_user_organizations' tool. It calls the supporting function getUserOrganizationsFunc() from the organization module and returns the result formatted as MCP tool response content.
    case "get_user_organizations": { const userOrgs = await organization.getUserOrganizationsFunc(); return { content: [{ type: "text", text: JSON.stringify(userOrgs, null, 2) }], }; }
  • Zod schemas defining the structure of organization info and the array of user organizations (output validation for the tool).
    export const OrganizationInfoSchema = z.object({ id: z.string().optional().describe("Organization ID"), name: z.string().optional().describe("Organization name"), description: z.string().optional().describe("Organization description"), }); export const UserOrganizationsInfoSchema = z.array(OrganizationInfoSchema);
  • Tool registration entry defining name, description, and empty input schema for 'get_user_organizations' in the base tools registry.
    { name: "get_user_organizations", description: "Get the list of organizations the current user belongs to", inputSchema: zodToJsonSchema(z.object({})), },
  • The core helper function that performs the API request to fetch the user's organizations and validates the response using UserOrganizationsInfoSchema.
    export async function getUserOrganizationsFunc( ): Promise<z.infer<typeof UserOrganizationsInfoSchema>> { const url = "/oapi/v1/platform/organizations"; const response = await yunxiaoRequest(url, { method: "GET", }); if (!Array.isArray(response)) { return []; } return UserOrganizationsInfoSchema.parse(response); }

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