Skip to content

Azure Retail Pricing MCP Tool#1621

Merged
anannya03 merged 6 commits intomicrosoft:mainfrom
anannya03:azure-retail-pricing
Feb 3, 2026
Merged

Azure Retail Pricing MCP Tool#1621
anannya03 merged 6 commits intomicrosoft:mainfrom
anannya03:azure-retail-pricing

Conversation

@anannya03
Copy link
Copy Markdown
Contributor

@anannya03 anannya03 commented Feb 1, 2026

What does this PR do?

Get Azure Retail Price MCP tool
Documentation: https://learn.microsoft.com/en-us/rest/api/cost-management/retail-prices/azure-retail-prices
API endpoint: https://prices.azure.com/api/retail/prices

Given the documentation and the endpoint, we wrote a typespec for the API and then generated the client. Since we hand-crafted the spec and generated the library ourselves, the best option discussed was to vendor this small client directly into the MCP tools project. The generated client is present in the \tools\Azure.Mcp.Tools.Pricing\src\Client folder.

get_azure_retail_pricing MCP tool result

image

The following prompts are supported with this tool-

  1. “What is the price for [SKU name / Resource]?”
  2. “What is the price for [X] Azure service?”
    Copilot should then clarify how the service works and then ask the user for which SKU under that Azure service they want the price for
  3. “Which SKU is cheaper - [SKU nameA / resource A] vs. [SKU nameB / resource B]?”
  4. “What is the price difference for x service in region 1 vs region 2?”
  5. “Given this bicep template, what will my price be for the deployment?”

GitHub issue number?

[Link to the GitHub issue this PR addresses]

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes using script at eng/scripts/Process-PackageReadMe.ps1. See Package README
    • Updated command list in /servers/Azure.Mcp.Server/docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • Run .\eng\scripts\Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new MCP tool for querying Azure Retail Pricing information. The tool provides programmatic access to retail prices for all Azure services through the public Azure Retail Prices API at https://prices.azure.com.

Changes:

  • Added pricing_get MCP tool with support for filtering by SKU, service, region, service family, price type, currency, and advanced OData filters
  • Vendored a TypeSpec-generated client library for the Azure Retail Prices API in the Client/ folder
  • Implemented comprehensive unit tests and recorded live tests using the test proxy infrastructure
  • Updated server documentation, command metadata, and consolidated tools configuration

Reviewed changes

Copilot reviewed 60 out of 60 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.Pricing/src/Services/PricingService.cs Core service implementing pricing queries with OData filter building and result mapping
tools/Azure.Mcp.Tools.Pricing/src/Commands/PricingGetCommand.cs Command implementation with validation requiring at least one filter and SKU when querying by service
tools/Azure.Mcp.Tools.Pricing/src/Client/* Vendored auto-generated client from TypeSpec for Azure Retail Prices API
tools/Azure.Mcp.Tools.Pricing/tests//.cs Comprehensive unit tests and recorded live tests
tools/Azure.Mcp.Tools.Pricing/tests/test-resources.bicep Empty resource file as API is public and unauthenticated
servers/Azure.Mcp.Server/src/Program.cs Registration of PricingSetup in the server
servers/Azure.Mcp.Server/docs/*.md Documentation updates with test prompts and command examples
core/Azure.Mcp.Core/src/Areas/Server/Resources/consolidated-tools.json Added get_azure_retail_pricing tool metadata
Directory.Packages.props Added System.ClientModel package dependency

Comment thread tools/Azure.Mcp.Tools.Pricing/src/Client/RetailPrices.RestClient.cs
Comment thread tools/Azure.Mcp.Tools.Pricing/src/Client/Internal/TypeFormatters.cs Outdated
Copy link
Copy Markdown
Member

@joshfree joshfree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great but it's missing the CHANGELOG and CODEOWNERS updates

@anannya03 anannya03 requested a review from a team as a code owner February 3, 2026 17:16
Copy link
Copy Markdown
Member

@anuchandy anuchandy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I skipped the contents of the client directory since it's TypeSpec-generated. I think we should push the TypeSpec you authored for the pricing service somewhere like the mcp-pr repo, along with generation instructions - this isn't available in the REST API spec repo.

Comment thread Directory.Packages.props
@anannya03 anannya03 merged commit 501a16b into microsoft:main Feb 3, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from Untriaged to Done in Azure MCP Server Feb 3, 2026
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Apr 20, 2026
* Get Azure Retail Pricing MCP Tool

* fixed recorded tests and tool description

* fuxed unit testcases

* fix: update live test to require SKU when service is provided

* copilot review comments

* added codeowners and changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants