Add Learn MCP Server tool-calling sample#642
Open
pdebruin wants to merge 4 commits into
Open
Conversation
Adds a JS sample that uses Foundry Local with the Learn MCP Server to create a doc-grounded Q&A assistant. The model calls a search_docs tool that queries learn.microsoft.com via MCP (JSON-RPC over HTTP), then synthesizes answers from official Microsoft documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@pdebruin is attempting to deploy a commit to the MSFT-AIP Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new JavaScript sample demonstrating tool-calling with Foundry Local, grounded by Microsoft Learn documentation retrieved via the Learn MCP Server (JSON-RPC over HTTP).
Changes:
- Adds a new JS sample (
samples/js/learn-mcp-tool-calling/) with an interactive CLI assistant that calls asearch_docstool backed by Learn MCP Server. - Updates the JS samples index to include the new sample.
- Updates the top-level samples README to reflect the new JS sample count (13).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| samples/js/learn-mcp-tool-calling/package.json | Adds a runnable Node.js sample package using foundry-local-sdk (+ WinML optional dep). |
| samples/js/learn-mcp-tool-calling/app.js | Implements the CLI assistant, MCP-backed search_docs tool, and a tool-calling loop. |
| samples/js/README.md | Adds the new sample to the JS samples table. |
| samples/README.md | Updates JavaScript sample count from 12 to 13 and mentions Learn MCP Server. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds a C# sample that uses Foundry Local with the Learn MCP Server to create a doc-grounded Q&A assistant. Adapted from tutorial-tool-calling with search_docs tool calling learn.microsoft.com via MCP (JSON-RPC). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds a C# sample (learn-mcp-tool-calling) that uses Foundry Local with the Learn MCP Server for doc-grounded Q&A. Hardened FormatSearchResults with TryGetProperty throughout and added ValueKind guards to prevent exceptions on unexpected MCP response shapes. Note: all C# tool-calling samples currently crash at runtime due to a Betalgo.Ranul.OpenAI version mismatch in the SDK (microsoft#632). The sample code is correct and will work once the SDK is updated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds JS and C# samples that use Foundry Local with the Learn MCP Server to create a doc-grounded Q&A assistant.
The model calls a
search_docstool that queries learn.microsoft.com via MCP (JSON-RPC over HTTP), then synthesizes answers from official Microsoft documentation. All inference runs locally on-device.JS sample (
samples/js/learn-mcp-tool-calling/):app.js,package.jsonC# sample (
samples/cs/learn-mcp-tool-calling/):Program.cs,LearnMcpToolCalling.csproj,LearnMcpToolCalling.slnREADME updates:
samples/README.md— updated JS count (12 → 13) and C# count (12 → 13)samples/js/README.md— added table entrysamples/cs/README.md— added table entry