microsoft-code-reference
Look up Microsoft API references, find working code samples, and verify SDK code is correct. Use when working with Azure SDKs, .NET libraries, or Microsoft APIs—to find the right method, check parameters, get working examples, or troubleshoot errors. Catches hallucinated methods, wrong signatures, a
By github · 14,098 installs
npx skills add github/awesome-copilot --skill microsoft-code-reference
Source repository · Upstream listing
Microsoft Code Reference
Tools
Need Tool Example
API method/class lookup microsoft docs search "BlobClient UploadAsync Azure.Storage.Blobs"
Working code sample microsoft code sample search query: "upload blob managed identity", language: "python"
Full API reference microsoft docs fetch Fetch URL from microsoft docs search (for overloads, full signatures)
Finding Code Samples
Use microsoft code sample search to get official, working examples:
When to use:
Before writing code—find a working pattern to follow
After errors—compare your code against a known good sample
Unsure of initialization/setup—samples show complete context
API Lookups
Fetch full page when method has multiple overloads or you need complete parameter details.
Error Troubleshooting
Use microsoft code sample search to find working code samples and compare with your implementation. For specific errors, use microsoft docs search and microsoft docs fetch :
Error Type Query
Method not found "[ClassName] methods [Namespace]"
Type not found "[TypeName] NuGet package namespace"
Wrong signature "[ClassName] [MethodName] overloads" → fetch full page
Deprecated warning "[OldType] migration v12"
Auth failure "DefaultAzureCredential troubleshooting"
403 Forbidden "[ServiceName] RBAC permissions"
When to Verify
Always verify when:
Method name seems "too convenient" ( UploadFile vs actual Upload )
Mixing SDK versions (v11 CloudBlobClient vs v12 BlobServiceClient )
Package name doesn't follow conventions ( Azure. for .NET, azure for Python)
Using an API for the first time
Validation Workflow
Before generating code using Microsoft SDKs, verify it's correct:
1. Confirm method or package exists — microsoft docs search(query: "[ClassName] [MethodName] [Namespace]")
2. Fetch full details (for overloads/complex params) — microsoft docs fetch(url: "...")
3. Find working sample — microsoft code sample search(query: "[task]", language: "[lang]")
For simple lookups, step 1 alone may suffice. For complex API usage, complete all three steps.
CLI Alternative
If the Learn MCP server is not available, use the mslearn CLI from a terminal or shell (for example, Bash, PowerShell, or cmd) instead:
MCP Tool CLI Command
microsoft docs search(query: "...") mslearn search "..."
microsoft code sample search(query: "...", language: "...") mslearn code search "..." language ...
microsoft docs fetch(url: "...") mslearn fetch "..."
Pass json to search or code search to get raw JSON output for further processing.