list-tenants
Retrieve configured Azure tenants with management group details and default subscription information from azure-config.json.
Instructions
List configured tenants from azure-config.json, including optional management group and default subscription info.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- Handler logic for the 'list-tenants' tool within the call_tool function. Retrieves configured tenants from AZURE_CONFIG, formats their details (name, ID, management group ID, default subscription ID), and returns as formatted text.if name == "list-tenants": tenants = AZURE_CONFIG.get_tenants() if not tenants: return [types.TextContent(type="text", text="No tenants configured.")] lines = [ "Configured tenants:", ] for t in tenants: name = t.get("name") or t.get("id") or "(unnamed)" tid = t.get("id") or "(no id)" mg = t.get("management_group_id") or t.get("managementGroupId") or "(none)" default_sub = t.get("default_subscription_id") or "(none)" lines.append(f"- {name} ({tid}) | management_group_id={mg} | default_subscription_id={default_sub}") return [types.TextContent(type="text", text="\n".join(lines))]
- src/azure_assistant_mcp/server.py:113-121 (registration)Registration of the 'list-tenants' tool in the list_tools() function, including name, description, and empty input schema (no parameters required).types.Tool( name="list-tenants", description="List configured tenants from azure-config.json, including optional management group and default subscription info.", inputSchema={ "type": "object", "properties": {}, "required": [], }, ),
- Input schema for 'list-tenants' tool: empty object schema with no properties or required fields.inputSchema={ "type": "object", "properties": {}, "required": [], }, ),