Skip to main content
Glama

list-tenants

Retrieve configured Azure tenants with management groups and default subscriptions from azure-config.json.

Instructions

List configured tenants from azure-config.json, including optional management group and default subscription info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler logic for the 'list-tenants' tool within the call_tool function. Retrieves tenants from config and formats them for output.
    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))]
  • Registration of the 'list-tenants' tool in the @server.list_tools() function, including name, description, and schema.
    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: no required properties.
    inputSchema={
        "type": "object",
        "properties": {},
        "required": [],
    },

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/andrewstephenson-v1/Azure-Assistant-MCP'

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