Skip to main content
Glama
msftnadavbh

Azure Pricing MCP Server

by msftnadavbh

azure_discover_skus

Find available SKUs for Azure services to compare pricing and features across regions, helping users select the right configuration for their needs.

Instructions

Discover available SKUs for a specific Azure service

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
service_nameYesAzure service name
regionNoAzure region (optional)
price_typeNoPrice type (default: 'Consumption')Consumption
limitNoMaximum number of SKUs to return (default: 100)

Implementation Reference

  • Core implementation of discover_skus in SKUService. This method builds filter conditions based on service_name, region, and price_type, fetches prices from the Azure pricing API, and aggregates unique SKUs with their metadata (name, price, region availability). Returns a structured response with SKU list, total count, and filter metadata.
    async def discover_skus(
        self,
        service_name: str,
        region: str | None = None,
        price_type: str = "Consumption",
        limit: int = 100,
    ) -> dict[str, Any]:
        """Discover available SKUs for a specific Azure service."""
        filter_conditions = [f"serviceName eq '{service_name}'"]
    
        if region:
            filter_conditions.append(f"armRegionName eq '{region}'")
    
        if price_type:
            filter_conditions.append(f"priceType eq '{price_type}'")
    
        data = await self._pricing_service._client.fetch_prices(
            filter_conditions=filter_conditions,
            currency_code="USD",
            limit=limit,
        )
    
        skus: dict[str, dict[str, Any]] = {}
        items = data.get("Items", [])
    
        for item in items:
            sku_name = item.get("skuName")
            arm_sku_name = item.get("armSkuName")
            product_name = item.get("productName")
            item_region = item.get("armRegionName")
            price = item.get("retailPrice", 0)
            unit = item.get("unitOfMeasure")
            meter_name = item.get("meterName")
    
            if sku_name and sku_name not in skus:
                skus[sku_name] = {
                    "sku_name": sku_name,
                    "arm_sku_name": arm_sku_name,
                    "product_name": product_name,
                    "sample_price": price,
                    "unit_of_measure": unit,
                    "meter_name": meter_name,
                    "sample_region": item_region,
                    "available_regions": [item_region] if item_region else [],
                }
            elif sku_name and item_region and item_region not in skus[sku_name]["available_regions"]:
                skus[sku_name]["available_regions"].append(item_region)
    
        sku_list = list(skus.values())
        sku_list.sort(key=lambda x: x["sku_name"])
    
        return {
            "service_name": service_name,
            "skus": sku_list,
            "total_skus": len(sku_list),
            "price_type": price_type,
            "region_filter": region,
        }
  • Tool handler that bridges MCP tool calls to the SKUService. The handle_discover_skus method receives arguments, calls the sku_service.discover_skus method, formats the result using format_discover_skus_response, and returns a TextContent object.
    async def handle_discover_skus(self, arguments: dict[str, Any]) -> list[TextContent]:
        """Handle azure_discover_skus tool calls."""
        result = await self._sku_service.discover_skus(**arguments)
        response_text = format_discover_skus_response(result)
        return [TextContent(type="text", text=response_text)]
  • Tool schema definition for azure_discover_skus. Defines the input parameters: service_name (required), region (optional), price_type (default: 'Consumption'), and limit (default: 100). This is used by MCP clients to understand the tool's interface.
    Tool(
        name="azure_discover_skus",
        description="Discover available SKUs for a specific Azure service",
        inputSchema={
            "type": "object",
            "properties": {
                "service_name": {
                    "type": "string",
                    "description": "Azure service name",
                },
                "region": {
                    "type": "string",
                    "description": "Azure region (optional)",
                },
                "price_type": {
                    "type": "string",
                    "description": "Price type (default: 'Consumption')",
                    "default": "Consumption",
                },
                "limit": {
                    "type": "integer",
                    "description": "Maximum number of SKUs to return (default: 100)",
                    "default": 100,
                },
            },
            "required": ["service_name"],
        },
    ),
  • Tool routing registration in the MCP server. This code maps the 'azure_discover_skus' tool name to its handler method (handle_discover_skus) within the server's call_tool handler.
    elif name == "azure_discover_skus":
        return await handlers.handle_discover_skus(arguments)
  • Response formatter for discover_skus output. Converts the structured result dictionary into a human-readable string, displaying the total count of SKUs found and formatting the SKU list as JSON. Returns a 'No SKUs found' message if the list is empty.
    def format_discover_skus_response(result: dict[str, Any]) -> str:
        """Format the discover SKUs response for display."""
        skus = result.get("skus", [])
        if skus:
            return f"Found {result['total_skus']} SKUs for {result['service_name']}:\n\n" + json.dumps(skus, indent=2)
        else:
            return "No SKUs found for the specified service."
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool discovers SKUs but doesn't mention whether this is a read-only operation, if it requires authentication, rate limits, or what the output format looks like. For a tool with 4 parameters and no output schema, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point without any wasted words. It's appropriately sized for the tool's complexity and front-loaded with the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 4 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what SKUs are, how results are structured, or provide context about Azure service naming conventions. For a discovery tool with multiple siblings, more contextual information would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description doesn't add any meaningful parameter semantics beyond what's in the schema (e.g., explaining what 'SKUs' are or how they relate to Azure services). The baseline of 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('discover') and resource ('available SKUs for a specific Azure service'), making the purpose immediately understandable. However, it doesn't explicitly distinguish this tool from its sibling 'azure_sku_discovery', which appears to serve a similar function based on the name alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'azure_sku_discovery' or other Azure pricing-related siblings. It mentions a specific Azure service context but offers no exclusions, prerequisites, or comparison with other tools in the server.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/msftnadavbh/AzurePricingMCP'

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