Skip to main content
Glama

list-resource-groups

Retrieve all resource groups within a specified Azure subscription to manage cloud resources effectively with secure authentication.

Instructions

List all resource groups in the selected subscription

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Primary MCP tool handler for 'list-resource-groups'. Performs caching, error handling, and delegates to AzureOperations.listResourceGroups() for execution.
    private async handleListResourceGroups() { if (!this.context.resourceClient) { throw new AzureMCPError("Client not initialized", "NO_CLIENT"); } try { const cacheKey = `resource-groups-${this.context.selectedSubscription}`; return await this.getCachedResource( cacheKey, async () => { // Use azureOperations to handle the business logic return await this.azureOperations.listResourceGroups(); }, 30000 ); } catch (error) { this.logWithContext("error", `Error listing resource groups: ${error}`, { error, }); throw new AzureResourceError(`Failed to list resource groups: ${error}`); } }
  • Core implementation logic in AzureOperations class that lists resource groups using the ResourceManagementClient.
    async listResourceGroups() { if (!this.context.resourceClient) { throw new AzureMCPError("Client not initialized", "NO_CLIENT"); } const resourceGroups = []; for await (const group of this.context.resourceClient.resourceGroups.list()) { resourceGroups.push({ id: group.id, name: group.name, location: group.location, tags: group.tags || {}, }); } return resourceGroups; }
  • Switch case registration that maps tool name to handler in handleCallTool()
    case "list-resource-groups": result = await this.handleListResourceGroups(); break;
  • Tool registration in handleListTools() including name, description, and input schema (no required parameters)
    { name: "list-resource-groups", description: "List all resource groups in the selected subscription", inputSchema: { type: "object", properties: {}, required: [], },
  • Input schema definition for the tool: empty object with no properties or requirements.
    inputSchema: { type: "object", properties: {}, required: [], },

Other Tools

Related 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/kalivaraprasad-gonapa/azure-mcp'

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