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

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