get_organization_role
Retrieve role details and permissions for users in Alibaba Cloud DevOps organizations to manage access control and team responsibilities.
Instructions
[Organization Management] Get information about an organization role
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organizationId | Yes | Organization ID | |
| roleId | Yes | Role ID |
Implementation Reference
- tool-handlers/organization.ts:98-107 (handler)Tool handler implementation: parses input arguments using the schema, calls the core getOrganizationRoleFunc, and returns the role as JSON string.case "get_organization_role": { const args = types.GetOrganizationRoleSchema.parse(request.params.arguments); const role = await organization.getOrganizationRoleFunc( args.organizationId, args.roleId ); return { content: [{ type: "text", text: JSON.stringify(role, null, 2)}] } }
- Core helper function that makes the API request to fetch the organization role and parses the response with OrganizationRoleSchema.export async function getOrganizationRoleFunc( organizationId: string, roleId: string ): Promise<z.infer<typeof OrganizationRoleSchema>> { const url = `/oapi/v1/platform/organizations/${organizationId}/roles/${roleId}`; const response = await yunxiaoRequest(url, { method: "GET" }); return OrganizationRoleSchema.parse(response); }
- tool-registry/organization.ts:62-65 (registration)Tool registration defining the name, description, and input schema.name: "get_organization_role", description: "[Organization Management] Get information about an organization role", inputSchema: zodToJsonSchema(types.GetOrganizationRoleSchema), },
- Input schema for the tool defining organizationId and roleId parameters.export const GetOrganizationRoleSchema = z.object({ organizationId: z.string().describe("Organization ID"), roleId: z.string().describe("Role ID") });
- operations/organization/types.ts:4-9 (schema)Output schema defining the structure of the organization role object.export const OrganizationRoleSchema = z.object({ id: z.string().describe("Role ID"), name: z.string().describe("Role name"), organizationId: z.string().describe("Organization ID"), permissions: z.array(z.string()).describe("Role permission list") });