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);
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it 'gets' a list, implying a read-only operation, but doesn't specify whether it returns all departments, supports pagination, requires specific permissions, or has rate limits. This leaves significant gaps in understanding how the tool behaves beyond basic functionality.

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 a single, clear sentence that efficiently communicates the core purpose without unnecessary words. It's front-loaded with the main action and resource, making it easy to parse quickly. Every word serves a functional purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's relative simplicity (list operation with 2 parameters), no annotations, and no output schema, the description is minimally adequate but lacks important context. It doesn't explain the return format (e.g., list structure, fields included) or behavioral aspects like permissions or pagination, which would be helpful for an agent to use it effectively.

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 input schema has 100% description coverage, with both parameters ('organizationId' and 'parentId') documented in the schema. The description doesn't add any meaningful semantic context beyond what's already in the schema, such as explaining how 'parentId' might filter results or providing examples. This meets the baseline for high schema coverage.

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 ('Get the list') and resource ('departments in an organization'), making the tool's purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_organization_department_info' or 'get_organization_department_ancestors', which appear to be related but serve different purposes.

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. There are sibling tools like 'get_organization_department_info' (likely for single department details) and 'get_organization_department_ancestors' (likely for hierarchical data), but the description doesn't mention these or provide any context for choosing between them.

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