Skip to main content
Glama
aliyun

AlibabaCloud DevOps MCP Server

Official
by aliyun

list_organization_departments

Retrieve department structures within an Alibaba Cloud organization to manage team hierarchies and access controls for DevOps workflows.

Instructions

Get the list of departments in an organization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationIdYesOrganization ID
parentIdNoParent department ID

Implementation Reference

  • Tool handler switch case that parses arguments using the schema, calls the core getOrganizationDepartmentsFunc, and returns the departments as JSON string.
    case "list_organization_departments": { const args = types.GetOrganizationDepartmentsSchema.parse(request.params.arguments); const departments = await organization.getOrganizationDepartmentsFunc( args.organizationId, args.parentId ?? undefined ); return { content: [{ type: "text", text: JSON.stringify(departments, null, 2) }], }; }
  • Tool registration entry defining name, description, and input schema reference.
    { name: "list_organization_departments", description: "Get the list of departments in an organization", inputSchema: zodToJsonSchema(types.GetOrganizationDepartmentsSchema), },
  • Zod input schema for the tool arguments: organizationId (required), parentId (optional).
    export const GetOrganizationDepartmentsSchema = z.object({ organizationId: z.string().describe("Organization ID"), parentId: z.string().optional().describe("Parent department ID"), });
  • Core helper function that constructs the API URL, makes the yunxiaoRequest GET call, and parses the response using OrganizationDepartmentsSchema.
    export async function getOrganizationDepartmentsFunc( organizationId: string, parentId?: string ): Promise<z.infer<typeof OrganizationDepartmentsSchema>> { const baseUrl = `/oapi/v1/platform/organizations/${organizationId}/departments`; const params: Record<string, string | undefined> = {}; if (parentId) { params.parentId = parentId; } const url = buildUrl(baseUrl, params); const response = await yunxiaoRequest(url, { method: "GET" }); return OrganizationDepartmentsSchema.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