Skip to content
Skillpedia
General coding40k · #5233

microsoft-code-reference

Helps your agent find Microsoft API references and code examples. It's useful for checking if SDK code is correct and for troubleshooting Microsoft APIs.

What it does

This tool helps you find information and code examples for using Microsoft technologies like Azure SDKs and .NET libraries. It checks if the commands you're thinking of using exist and are correct, and provides examples of how to use them.

When to use it

  • ✓When you're unsure if a command or function exists.
  • ✓To find code examples showing how to use a Microsoft tool.
  • ✓To verify your code is using the correct and up-to-date commands.

Example of what to ask your AI

“Find an example of how to upload a file to Azure Blob Storage in Python.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/github/awesome-copilot/blob/main/skills/microsoft-code-reference/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/microsoft-code-reference/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

You can ask it to search for a specific method, like 'BlobClient UploadAsync Azure.Storage.Blobs', or request code examples for a task, like 'send Service Bus message in Javascript'. The tool consults official Microsoft documentation to ensure the information is accurate.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add github/awesome-copilot --skill microsoft-code-reference

Or download just the file:

curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/microsoft-code-reference/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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:

microsoft_code_sample_search(query: "upload file to blob storage", language: "csharp")
microsoft_code_sample_search(query: "authenticate with managed identity", language: "python")
microsoft_code_sample_search(query: "send message service bus", language: "javascript")

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

# Verify method exists (include namespace for precision)
"BlobClient UploadAsync Azure.Storage.Blobs"
"GraphServiceClient Users Microsoft.Graph"

# Find class/interface
"DefaultAzureCredential class Azure.Identity"

# Find correct package
"Azure Blob Storage NuGet package"
"azure-storage-blob pip package"

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:

# Run directly (no install needed)
npx @microsoft/learn-cli search "BlobClient UploadAsync Azure.Storage.Blobs"

# Or install globally, then run
npm install -g @microsoft/learn-cli
mslearn search "BlobClient UploadAsync Azure.Storage.Blobs"
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.

FAQ

What are 'APIs' and 'SDKs'?

APIs (Application Programming Interfaces) are like menus that allow different computer programs to talk to each other. SDKs (Software Development Kits) are sets of tools and instructions that help developers build applications using these APIs.

What does 'verify code is correct' mean?

It means making sure the commands you're writing actually exist, are spelled and used the right way (with the correct parameters), and aren't old versions that have been replaced by newer ones.

What are 'hallucinations' in this context?

In AI, 'hallucinations' are when the AI makes up information that isn't true. This tool helps prevent the AI from suggesting commands or code examples that don't exist or are incorrect.

Details

Original description by the author

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, and deprecated patterns by querying official docs.

repo: github/awesome-copilot

Popularity

GitHub stars
40k
Ranking position
#5233
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills