Microsoft Code Sample Search
microsoft_code_sample_searchSearch for code snippets and examples in official Microsoft Learn documentation.
How it works ↓Pricing
Per call
$0.01
Model
flat
Pay only for what you use. No subscriptions.
Inputs
language
stringquery *
stringInput Parameters
Cost per run
Execution cost$0.01
About Microsoft Code Sample Search
Search for code snippets and examples in official Microsoft Learn documentation. This tool retrieves relevant code samples from Microsoft documentation pages providing developers with practical implementation examples and best practices for Microsoft/Azure products and services related coding tasks. This tool will help you use the LATEST OFFICIAL code snippets to empower coding capabilities.
When to Use This Tool
- When you are going to provide sample Microsoft/Azure related code snippets in your answers.
- When you are generating any Microsoft/Azure related code.
Usage Pattern
Input a descriptive query, or SDK/class/method name to retrieve related code samples. The optional parameter language can help to filter results.
Eligible values for language parameter include: csharp javascript typescript python powershell azurecli al sql java kusto cpp go rust ruby php
Frequently Asked Questions
Search for code snippets and examples in official Microsoft Learn documentation. This tool retrieves relevant code samples from Microsoft documentation pages providing developers with practical implementation examples and best practices for Microsoft/Azure products and services related coding tasks. This tool will help you use the **LATEST OFFICIAL** code snippets to empower coding capabilities. ## When to Use This Tool - When you are going to provide sample Microsoft/Azure related code snippets in your answers. - When you are **generating any Microsoft/Azure related code**. ## Usage Pattern Input a descriptive query, or SDK/class/method name to retrieve related code samples. The optional parameter `language` can help to filter results. Eligible values for `language` parameter include: csharp javascript typescript python powershell azurecli al sql java kusto cpp go rust ruby php
Microsoft Code Sample Search costs $0.01 per call on xpay. No subscription, no minimums. Pay only for the calls you make. New accounts get $5 in free credits.
Connect the Microsoft Learn MCP endpoint to your client — Claude Code: claude mcp add --transport http microsoft-learn "https://microsoft-learn.mcp.xpay.sh/mcp?key=YOUR_XPAY_KEY"; Cursor/Windsurf/Cline/VS Code: same URL in mcp.json. The agent will see microsoft_code_sample_search as a callable tool with the input schema and run it directly. (Unified across all providers: https://mcp.xpay.sh/mcp?key=YOUR_XPAY_KEY, then xpay_run with toolPath microsoft-learn/microsoft_code_sample_search.)
Yes — that's exactly what xpay is for. You don't need a Microsoft Learn account or API key. Sign up at xpay.tools (Google or email), get $5 free credit, and run Microsoft Code Sample Search immediately. Billing flows through your xpay balance.
Microsoft Code Sample Search accepts 2 input parameters: language, query. See the input schema and runnable form on this page for details and to test live.

