---
name: "mslearn"
description: "Query the live Microsoft Learn MCP (https://learn.microsoft.com/api/mcp) for grounded, first-party docs, code samples, and full-page fetches across Azure, M365, .NET, Power Platform, etc. Use whenever the user asks \"what does Microsoft say about X\", needs an authoritative answer for a customer, wants the latest official guidance, looks for a code sample, or asks to cite/quote Learn docs. Triggers: \"ms learn\", \"microsoft learn\", \"learn docs\", \"look up on learn\", \"cite the docs\", \"official microso"
---

MS Learn MCP skill

Calls the public Microsoft Learn MCP server at https://learn.microsoft.com/api/mcp over JSON-RPC 2.0. No auth required. Use this to ground customer-facing answers in live, first-party Microsoft documentation.

## Three tools available

| Tool | Purpose | Args |
|---|---|---|
| microsoft_docs_search | Top-10 doc chunks (<=500 tokens each). Always start here. | query (string) |
| microsoft_code_sample_search | Official code snippets. Use when generating any MS/Azure code. | query (string), language (optional: csharp, javascript, typescript, python, powershell, azurecli, al, sql, java, kusto, cpp, go, rust, ruby, php) |
| microsoft_docs_fetch | Full page -> markdown. Use AFTER search when a result looks high-value or is truncated. | url (must be microsoft.com HTML page) |

## How to call (PowerShell)

```powershell
$body = @{
  jsonrpc = "2.0"
  id      = 1
  method  = "tools/call"
  params  = @{
    name      = "microsoft_docs_search"
    arguments = @{ query = "YOUR QUERY HERE" }
  }
} | ConvertTo-Json -Compress -Depth 6

curl.exe -s -X POST "https://learn.microsoft.com/api/mcp" `
  -H "Content-Type: application/json" `
  -H "Accept: application/json, text/event-stream" `
  -d $body
```

Response is SSE-framed: skip the `event: message\ndata:` prefix, then JSON-parse. The `result.content[0].text` field is itself JSON - parse it again to get `results[]`.

Quick parser:

```powershell
$raw = curl.exe ...   # as above
$json = ($raw -join "`n") -replace '^event:.*\ndata: ',''
$outer = $json | ConvertFrom-Json
$inner = $outer.result.content[0].text | ConvertFrom-Json
$inner.results | ForEach-Object { "[$($_.title)]($($_.contentUrl))`n$($_.content)`n" }
```

## Workflow for a customer answer

1. Search with `microsoft_docs_search` using the user's question verbatim or refined keywords.
2. Skim top results. If they fully answer the question, synthesize and cite.
3. If a result is truncated, ambiguous, or canonical, fetch it with `microsoft_docs_fetch`.
4. If the user wants code, also call `microsoft_code_sample_search` with the right language.
5. Compose response with inline citations: every claim from Learn must link to source `contentUrl`.

## Output style for customer-facing answers

1. Lead with a one-paragraph plain-English answer.
2. Follow with bullet points of key facts, each citing `[Source title](url)`.
3. If quoting code, fence it with the right language and cite the sample link.
4. End with a **Sources** section listing every URL used.
5. Never paraphrase beyond the docs. If Learn doesn't cover it, say so explicitly.

## When NOT to use

- Internal Microsoft content (Seismic, MSX, Learn Pathways gated content): use other skills.
- Non-Microsoft topics.
- Time-sensitive pricing/SLAs: confirm on official pricing pages after Learn points to them.
