list_organization_members
Retrieve user members within an Alibaba Cloud DevOps organization by providing the organization ID, with optional pagination support for managing team access and permissions.
Instructions
list user members in an organization
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organizationId | Yes | Organization ID | |
| page | No | Page number | |
| perPage | No | Page size |
Implementation Reference
- tool-handlers/organization.ts:41-51 (handler)Tool handler that parses arguments with GetOrganizationMembersSchema, invokes the helper function getOrganizationMembersFunc, and formats the response as JSON text.case "list_organization_members": { const args = types.GetOrganizationMembersSchema.parse(request.params.arguments); const orgMembers = await members.getOrganizationMembersFunc( args.organizationId, args.page ?? 1, args.perPage ?? 100 ); return { content: [{ type: "text", text: JSON.stringify(orgMembers, null, 2)}] } }
- Zod schema defining the input parameters for the list_organization_members tool: organizationId (required), page and perPage (optional).export const GetOrganizationMembersSchema = z.object({ organizationId: z.string().describe("Organization ID"), page: z.number().int().optional().describe("Page number"), perPage: z.number().int().optional().describe("Page size"), });
- tool-registry/organization.ts:36-40 (registration)Tool registration entry defining the name, description, and input schema for list_organization_members.{ name: "list_organization_members", description: "list user members in an organization", inputSchema: zodToJsonSchema(types.GetOrganizationMembersSchema), },
- Core helper function that builds the API endpoint URL, performs a GET request via yunxiaoRequest to fetch organization members, and validates the response using OrganizationMembersSchema.export const getOrganizationMembersFunc = async ( organizationId: string, page: number = 1, perPage: number = 100 ): Promise<OrganizationMembers> => { const url = `/oapi/v1/platform/organizations/${organizationId}/members`; const params = { page: page, perPage: perPage }; const urlWithParams = buildUrl(url, params); const response = await yunxiaoRequest(urlWithParams, { method: "GET", }); // 验证响应数据结构 return OrganizationMembersSchema.parse(response); };