"""Canonical KQL builders used by both nl2kql and server tools.
All resource type comparisons use =~ for case-insensitive matching.
Templates-only mode: Builders load human-editable templates from
`src/azure_assistant_mcp/kql/{name}.kql` or `{name}.md` (fenced kql block).
If a template is missing, a RuntimeError is raised so the issue is fixed
instead of silently falling back.
"""
from typing import Iterable, Optional
from .kql_loader import load_kql_template
def _tmpl(name: str) -> str:
tpl = load_kql_template(name)
if not tpl:
raise RuntimeError(f"Missing KQL template: {name}")
return tpl
def list_subscriptions_kql() -> str:
return _tmpl("list_subscriptions")
def list_resource_groups_kql(limit: int = 50) -> str:
# limit is currently defined by the template
return _tmpl("list_resource_groups")
def untagged_resource_groups_kql() -> str:
return _tmpl("untagged_resource_groups")
def stopped_vms_kql() -> str:
return _tmpl("stopped_vms")
def vm_count_kql() -> str:
return _tmpl("vm_count")
def advisor_recommendations_kql() -> str:
return _tmpl("advisor_recommendations")
def policy_noncompliant_kql() -> str:
return _tmpl("policy_noncompliant")
def health_advisories_kql() -> str:
return _tmpl("health_advisories")
def public_ips_kql() -> str:
return _tmpl("public_ips")
def unencrypted_storage_kql() -> str:
return _tmpl("unencrypted_storage")
def keyvault_network_kql() -> str:
return _tmpl("keyvault_network")
def generic_list_resources_kql(limit: int = 50) -> str:
# limit is currently defined by the template
return _tmpl("generic_list_resources")
def resource_changes_recent_kql(days: int = 7) -> str:
return _tmpl("resource_changes_recent")
def manual_changes_kql(days: int = 30, resource_groups: Optional[Iterable[str]] = None) -> str:
# days and resource_groups are defined by the template
return _tmpl("manual_changes")
def resource_container_changes_recent_kql(days: int = 30) -> str:
return _tmpl("resource_container_changes_recent")
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/iOSDevil/Azure-Assistant-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server