Microsoft Learn
https://learn.microsoft.com/api/mcp
Search, retrieve code samples from, and fetch full pages of official Microsoft Learn and Azure documentation.
81.0/100
#13 of 32 · #2 in Docs & knowledge
Fix it with your coding agent
Free. Paste this into Claude Code, Cursor or Codex inside your server's repo.
Improve the MCP server at https://learn.microsoft.com/api/mcp so AI agents can use it better. It scored 81/100 (B+) on the Agnost MCP Leaderboard.
Top fixes:
1. Add a `required: ["query"]` list to microsoft_docs_search's input schema and document the query format (natural-language vs keywords, max length) so agents don't guess which params are mandatory.
2. Define an outputSchema for microsoft_docs_fetch (markdown body, title, source URL, truncation flag) and state which URL domains are accepted (learn.microsoft.com only?) and how errors and oversized pages are handled.
3. In microsoft_code_sample_search, enumerate the accepted `language` filter values (e.g. csharp, python, javascript, powershell, azurecli) and describe each result's fields (code, language, source URL, description) so agents can filter and cite correctly.
Per-tool fixes:
- microsoft_docs_search: Add "required": ["query"] to the schema. Add the line: 'For code snippets, prefer microsoft_code_sample_search; to read a full page, use microsoft_docs_fetch.' Remove the phrase 'most relevant and trustworthy'. 'query' is not marked required in the schema and has a null default, even though the tool cannot work without it Does not say when to use this instead of microsoft_code_sample_search for code-focused questions Contains promotional wording such as 'Always use this tool' and 'high-quality, trustworthy' Bad-input test (wrong type: query) got an unhelpful error: "An error occurred invoking 'microsoft_docs_search'." No `required` list — agents must guess which params are mandatory
- microsoft_docs_fetch: Specify the accepted URL form, for example 'https://learn.microsoft.com/...'. Note whether very long pages get truncated. The domain rule says microsoft.com but the description elsewhere says Microsoft Learn; it is unclear whether learn.microsoft.com subpaths and other subdomains are accepted Does not mention size or truncation behavior for very long pages Bad-input test (missing required: url) got an unhelpful error: "An error occurred invoking 'microsoft_docs_fetch'." Bad-input test (wrong type: url) got an unhelpful error: "An error occurred invoking 'microsoft_docs_fetch'." No outputSchema — agents can't tell what the tool returns
- microsoft_code_sample_search: Add an enum for 'language' and remove the duplicate list from the description. State the output, for example: 'Returns code snippets with the source page URL and language.' Delete the marketing sentence. The list of language values appears in both the description and the parameter, but the schema has no enum Does not describe the returned result format (snippet, source URL, language) Uses emphasis filler such as '**LATEST OFFICIAL**' and 'empower coding capabilities' Bad-input test (missing required: query) got an unhelpful error: "An error occurred invoking 'microsoft_code_sample_search'." Bad-input test (wrong type: query) got an unhelpful error: "An error occurred invoking 'microsoft_code_sample_search'."
Keep tool names stable. Add readOnlyHint/destructiveHint annotations and outputSchema where missing.Score breakdown
Weighted by what breaks agents in 100M+ real MCP calls.
Error quality
6 bad-input tests · 0 clear errors
55/100 · 20 pts
↳ Clear errors that name the fix get ~3× more successful retries
Task success across agents
opus-5-5: 3/3 · haiku-5-5: 3/3 · gpt-5.5: 3/3 · first-call success 100% · 1.1 calls/task
99/100 · 15 pts
↳ The same tool can fail 0% of the time in one client and 13% in another
Tool count & token cost
3 tools · ~1,622 tokens · 1 overlapping pairs
94/100 · 15 pts
↳ The top 3 tools usually get >99% of calls; the rest just cost context
Schema & docs accuracy
Descriptions 85/100 · output matched schema 8/8
91/100 · 15 pts
↳ Declared output schemas that don't match real output break calls
Response size
median ~2,304 tokens · p95 ~5,651 · no limit params
62/100 · 10 pts
↳ Big responses overflow the agent's context; ~30% of search responses exceed 25k tokens
Latency & long calls
median 615ms · p95 1101ms · 0 timeouts
96/100 · 10 pts
↳ After a client cancels a long call, ~39% of sessions end
Connection & login
handshake 885ms · Streamable HTTP
100/100 · 10 pts
↳ After a login or permission error, ~1 in 5 sessions end
Metadata & discoverability
metadata 45/100 · Listed in the official MCP Registry ✓ · mcp.json manifest ✕ · Setup page in the browser ✕
39/100 · 5 pts
↳ The basics. Necessary, but not what makes agents succeed
What your errors look like to an agent
We sent deliberately bad inputs. Errors that name the bad field and the valid values get ~3× more successful retries in real agent traffic.
Sent the wrong type · microsoft_docs_search.query
Model sees it · "An error occurred invoking 'microsoft_docs_search'."
Left out a required field · microsoft_code_sample_search.query
Model sees it · "An error occurred invoking 'microsoft_code_sample_search'."
Sent the wrong type · microsoft_code_sample_search.query
Model sees it · "An error occurred invoking 'microsoft_code_sample_search'."
Left out a required field · microsoft_docs_fetch.url
Model sees it · "An error occurred invoking 'microsoft_docs_fetch'."
Sent the wrong type · microsoft_docs_fetch.url
Model sees it · "An error occurred invoking 'microsoft_docs_fetch'."
Called a tool that doesn't exist · —
Protocol error (often hidden from the model) · "Unknown tool: '__agnost_nonexistent_tool__'"
We let a real AI agent use it
3 AI models got realistic tasks and the full tool list. We checked if the first call was right, how many calls it took, and if it finished the job. It used ~5,414 tokens per task on average.
opus-5-5Find Microsoft documentation explaining how to configure autoscaling for Azure App Service.
Right tool first try · 7.6s · microsoft_docs_search
opus-5-5Show me a Python code example for uploading a blob to Azure Blob Storage using the Azure SDK.
Right tool first try · 8.7s · microsoft_code_sample_search
opus-5-5Get the full content of the page https://learn.microsoft.com/en-us/azure/azure-functions/functions-overview as markdown.
Right tool first try · 13.1s · microsoft_docs_fetch
haiku-5-5Find Microsoft documentation explaining how to configure autoscaling for Azure App Service.
Right tool first try · 5.0s · microsoft_docs_search
haiku-5-5Show me a Python code example for uploading a blob to Azure Blob Storage using the Azure SDK.
Right tool first try · 3.6s · microsoft_code_sample_search
haiku-5-5Get the full content of the page https://learn.microsoft.com/en-us/azure/azure-functions/functions-overview as markdown.
Right tool first try · 6.5s · microsoft_docs_fetch
gpt-5.5Find Microsoft documentation explaining how to configure autoscaling for Azure App Service.
Right tool first try · 7.1s · microsoft_docs_search → microsoft_docs_fetch
gpt-5.5Show me a Python code example for uploading a blob to Azure Blob Storage using the Azure SDK.
Right tool first try · 5.5s · microsoft_code_sample_search
gpt-5.5Get the full content of the page https://learn.microsoft.com/en-us/azure/azure-functions/functions-overview as markdown.
Right tool first try · 8.3s · microsoft_docs_fetch
Top 3 fixes
- 1
Add a `required: ["query"]` list to microsoft_docs_search's input schema and document the query format (natural-language vs keywords, max length) so agents don't guess which params are mandatory.
- 2
Define an outputSchema for microsoft_docs_fetch (markdown body, title, source URL, truncation flag) and state which URL domains are accepted (learn.microsoft.com only?) and how errors and oversized pages are handled.
- 3
In microsoft_code_sample_search, enumerate the accepted `language` filter values (e.g. csharp, python, javascript, powershell, azurecli) and describe each result's fields (code, language, source URL, description) so agents can filter and cite correctly.