Skip to main content
Glama
aliyun

AlibabaCloud DevOps MCP Server

Official
by aliyun

get_current_organization_info

Retrieve current user and organization details from Alibaba Cloud DevOps platform using authentication tokens for identity verification and access control.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool handler case that executes get_current_organization_info by calling the core function and returning formatted JSON response.
    case "get_current_organization_info": {
      const currentOrgInfo = await organization.getCurrentOrganizationInfoFunc();
      return {
        content: [{ type: "text", text: JSON.stringify(currentOrgInfo, null, 2) }],
      };
    }
  • Core helper function that performs the API request to fetch current organization info, maps the response, and validates with schema.
    export async function getCurrentOrganizationInfoFunc(
    ): Promise<z.infer<typeof CurrentOrganizationInfoSchema>> {
      const url = "/oapi/v1/platform/user";
    
      const response = await yunxiaoRequest(url, {
        method: "GET",
      });
    
      const responseData = response as { 
        lastOrganization?: string;
        id?: string; 
        name?: string;
      };
    
      const mappedResponse = {
        lastOrganization: responseData.lastOrganization, // Organization ID
        userId: responseData.id,                         // Map API's "id" to userId
        userName: responseData.name                      // Map API's "name" to userName
      };
    
      return CurrentOrganizationInfoSchema.parse(mappedResponse);
    }
  • Zod schema defining the output structure for current organization information.
    export const CurrentOrganizationInfoSchema = z.object({
      lastOrganization: z.string().optional().describe("Organization ID of the most recent login, used for subsequent API calls, should be used as organizationId"),
      userId: z.string().optional().describe("Current user ID, not the organization ID"),
      userName: z.string().optional().describe("Current user name"),
    });
  • Tool registration defining name, description, and empty input schema (converted to JSON schema).
    {
      name: "get_current_organization_info",
      description: "Get information about the current user and organization based on the token. In the absence of an explicitly specified organization 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 doesn't disclose other behavioral traits like whether it's read-only, what data it returns, error conditions, or rate limits. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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

Conciseness4/5

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

The description is two sentences that are front-loaded with the core purpose. The first sentence states what the tool does, and the second adds important contextual nuance. There's no wasted text, though it could be slightly more structured (e.g., explicitly separating purpose from guidelines).

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 the tool has no parameters (simple input) and no output schema, the description provides basic purpose and some usage context. However, it lacks details on what specific information is returned (e.g., user vs. organization fields), authentication requirements beyond 'token', or error handling. For a tool with zero annotations and no output schema, this leaves the agent with incomplete operational understanding.

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 tool has 0 parameters, and schema description coverage is 100% (though trivial since there are no parameters). The description doesn't need to add parameter semantics, but it does clarify that no organization ID is required ('In the absence of an explicitly specified organization ID'), which aligns with the empty schema. This earns a baseline 4 for zero-parameter tools.

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 tool's purpose: 'Get information about the current user and organization based on the token.' It specifies the verb ('Get'), resource ('information about the current user and organization'), and mechanism ('based on the token'). However, it doesn't explicitly differentiate from sibling tools like 'get_current_user' or 'get_user_organizations', which reduces it from 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 Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some implied usage guidance: 'In the absence of an explicitly specified organization ID, this result will take precedence.' This suggests it's the default tool for organization info when no ID is provided. However, it doesn't explicitly state when to use this vs. alternatives like 'get_organization_department_info' or 'get_user_organizations', nor does it mention prerequisites or exclusions.

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