Skip to main content
Glama
aliyun

AlibabaCloud DevOps MCP Server

Official
by aliyun

get_current_user

Retrieve current user information from Alibaba Cloud DevOps platform using authentication token to identify active sessions and access permissions.

Instructions

Get information about the current user based on the token. In the absence of an explicitly specified user ID, this result will take precedence.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'get_current_user' tool that invokes getCurrentUserFunc and formats the response as JSON.
    case "get_current_user": { const currentUserInfo = await organization.getCurrentUserFunc(); return { content: [{ type: "text", text: JSON.stringify(currentUserInfo, null, 2) }], }; }
  • Zod schema defining the structure of the current user information returned by the tool.
    export const CurrentUserSchema = z.object({ id: z.string().nullable().optional().describe("User ID"), name: z.string().optional().describe("Display name"), email: z.string().optional().describe("Email address"), username: z.string().optional().describe("Login account name"), lastOrganization: z.string().optional().describe("Last login organization ID"), staffId: z.string().optional().describe("Staff ID"), nickName: z.string().optional().describe("Nickname"), sysDeptIds: z.array(z.string()).optional().describe("Department IDs"), createdAt: z.string().optional().describe("Creation time (ISO 8601格式)"), deletedAt: z.string().optional().describe("Deletion time (ISO 8601格式)") });
  • Core implementation function that fetches current user data from the API endpoint '/oapi/v1/platform/user' and validates it using CurrentUserSchema.
    export async function getCurrentUserFunc(): Promise<z.infer<typeof CurrentUserSchema>> { const url = "/oapi/v1/platform/user"; const response = await yunxiaoRequest(url, { method: "GET", }); return CurrentUserSchema.parse(response); }
  • Tool registration defining the name, description, and empty input schema for 'get_current_user'.
    { name: "get_current_user", description: "Get information about the current user based on the token. In the absence of an explicitly specified user ID, this result will take precedence.", inputSchema: zodToJsonSchema(z.object({})), }
  • Additional tool registration for 'get_current_user' in organization-specific registry.
    { name: "get_current_user", description: "Get information about the current user based on the token. In the absence of an explicitly specified user ID, this result will take precedence.", inputSchema: zodToJsonSchema(z.object({})), },

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