get_organization_member_info_by_user_id
Retrieve organization member details using user ID to access role, permissions, and profile information for Alibaba Cloud DevOps platform management.
Instructions
Get information about a member in an organization by user ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organizationId | Yes | 组织 ID | |
| userId | Yes | 用户 ID |
Implementation Reference
- tool-handlers/organization.ts:64-70 (handler)Handler implementation for the tool: parses arguments with schema, invokes the core function getOrganizationMemberByUserIdInfoFunc, and formats response as JSON text.case "get_organization_member_info_by_user_id": { const args = types.GetOrganizationMemberByUserIdInfoSchema.parse(request.params.arguments); const memberInfo = await members.getOrganizationMemberByUserIdInfoFunc(args.organizationId, args.userId); return { content: [{ type: "text", text: JSON.stringify(memberInfo, null, 2)}] } }
- Zod schema defining the input parameters for the tool: organizationId (string) and userId (string).export const GetOrganizationMemberByUserIdInfoSchema = z.object({ organizationId: z.string().describe("组织 ID"), userId: z.string().describe("用户 ID"), });
- tool-registry/organization.ts:46-50 (registration)Tool registration entry in the organization tools array, including name, description, and input schema.{ name: "get_organization_member_info_by_user_id", description: "Get information about a member in an organization by user ID", inputSchema: zodToJsonSchema(types.GetOrganizationMemberByUserIdInfoSchema), },
- Core helper function that performs the API request to retrieve organization member info by user ID using yunxiaoRequest to the endpoint /oapi/v1/platform/organizations/{organizationId}/members:readByUser?userId={userId}, and parses the response.export const getOrganizationMemberByUserIdInfoFunc = async ( organizationId: string, userId: string ): Promise<GetOrganizationMemberInfo> => { const url = `/oapi/v1/platform/organizations/${organizationId}/members:readByUser`; const params = { userId: userId }; const urlWithParams = buildUrl(url, params); const response = await yunxiaoRequest(urlWithParams, { method: "GET", }); return MemberInfoSchema.parse(response); };