Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

list_users

Retrieve a list of users in CloudStack MCP Server by filtering based on account, domain ID, or user state for efficient user management.

Instructions

List users

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountNoAccount name to filter users
domainidNoDomain ID to filter users
stateNoUser state

Implementation Reference

  • The handler function that implements the core logic for the 'list_users' tool: fetches users from CloudStack API, maps and formats the data into a readable MCP response.
    async handleListUsers(args: any) { const result = await this.cloudStackClient.listUsers(args); const users = result.listusersresponse?.user || []; const userList = users.map((user: any) => ({ id: user.id, username: user.username, firstname: user.firstname, lastname: user.lastname, email: user.email, state: user.state, account: user.account, accounttype: user.accounttype, domain: user.domain, created: user.created })); return { content: [ { type: 'text', text: `Found ${userList.length} users:\n\n${userList .map((user: any) => `• ${user.username} (${user.id})\n Name: ${user.firstname} ${user.lastname}\n Email: ${user.email}\n State: ${user.state}\n Account: ${user.account}\n Domain: ${user.domain}\n Created: ${user.created}\n` ) .join('\n')}` } ] }; }
  • The tool schema definition for 'list_users', including name, description, and input schema for MCP tool registration.
    { name: 'list_users', description: 'List users', inputSchema: { type: 'object', properties: { account: { type: 'string', description: 'Account name to filter users', }, domainid: { type: 'string', description: 'Domain ID to filter users', }, state: { type: 'string', description: 'User state', }, }, additionalProperties: false, }, },
  • src/server.ts:184-185 (registration)
    The switch case in the MCP server that registers and routes 'list_users' tool calls to the appropriate handler.
    case 'list_users': return await this.adminHandlers.handleListUsers(args);
  • Helper method in CloudStack client that makes the actual API request to CloudStack's listUsers endpoint.
    async listUsers(params: CloudStackParams = {}): Promise<CloudStackResponse> { return this.request('listUsers', params); }

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/phantosmax/cloudstack-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server