Skip to main content
Glama

list-resource-groups

Retrieve all resource groups within your Azure subscription to manage and organize cloud resources effectively.

Instructions

List all resource groups in the selected subscription

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool registration defining the name, description, and empty input schema in the listTools response.
    { name: "list-resource-groups", description: "List all resource groups in the selected subscription", inputSchema: { type: "object", properties: {}, required: [], },
  • Wrapper handler method that implements caching and error handling, delegating to AzureOperations.listResourceGroups()
    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 in AzureOperations class that iterates over ResourceManagementClient.resourceGroups.list() to collect and return resource group details (id, name, location, tags).
    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; }

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