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({})),
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the tool uses 'the token' for authentication, which is useful context, but lacks details on rate limits, error handling, or what specific user information is returned. For a read operation with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief (two sentences) but could be more front-loaded; the second sentence about precedence adds context but might be better integrated. It avoids waste but isn't optimally structured for immediate clarity.

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 0 parameters and no output schema, the description is moderately complete but insufficient for a tool with no annotations. It explains the basic action and token-based auth but omits details on return values, error cases, or how it interacts with sibling tools, leaving room for improvement.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate, earning a baseline score of 4 for adequately handling the lack of parameters.

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 verb ('Get information') and resource ('about the current user'), making the purpose understandable. However, it doesn't distinguish this tool from potential siblings like 'get_user_organizations' or 'get_organization_member_info' that might also retrieve user-related data, preventing a perfect score.

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 minimal guidance with 'In the absence of an explicitly specified user ID, this result will take precedence,' which hints at a default behavior but doesn't explicitly state when to use this tool versus alternatives (e.g., 'get_organization_member_info_by_user_id' for specific users). No clear exclusions or prerequisites are mentioned.

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