Skip to content

Improve learning messaging#2987

Closed
conniey wants to merge 8 commits into
microsoft:mainfrom
conniey:ImproveLearningMessaging
Closed

Improve learning messaging#2987
conniey wants to merge 8 commits into
microsoft:mainfrom
conniey:ImproveLearningMessaging

Conversation

@conniey

@conniey conniey commented Jul 1, 2026

Copy link
Copy Markdown
Member

What does this PR do?

[Provide a clear, concise description of the changes]

[Add additional context, screenshots, or information that helps reviewers]

GitHub issue number?

[Link to the GitHub issue this PR addresses]

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines the “learn” experience across MCP tool loaders by reducing schema noise in learn-mode prompts and improving the guidance text so agents can more reliably pick tools/commands and required parameters.

Changes:

  • Introduces ToolCommandInfo and updates JSON source generation to support serializing a slimmed learn-mode view (name/description + properties/required).
  • Updates tool loaders (Server/Namespace/SingleProxy) to emit improved learn-mode messaging and to feed slimmer JSON into sampling prompts.
  • Renames SingleProxyToolLoader.GetToolListAsync (public surface used by tests) to GetMcpClientToolListAsync and adjusts tests accordingly.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
core/Microsoft.Mcp.Core/src/Areas/Server/ServerJsonContext.cs Registers ToolCommandInfo types for source-gen JSON serialization and cleans up ignore-condition usage.
core/Microsoft.Mcp.Core/src/Areas/Server/Models/ToolCommandInfo.cs Adds a lightweight model for learn-mode serialization of command/tool info.
core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/SingleProxyToolLoader.cs Refactors learn-mode flow to cache tool lists and pass slim JSON into sampling.
core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/ServerToolLoader.cs Improves learn-mode text and switches sampling payloads to ToolCommandInfo.
core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/NamespaceToolLoader.cs Improves learn-mode text and switches sampling payloads to ToolCommandInfo.
core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/CommandFactoryToolLoader.cs Updates XML doc text to remove Azure-specific wording.
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/SingleProxyToolLoaderTests.cs Updates tests to match renamed API (GetMcpClientToolListAsync).

Next, identify the command you want to execute and run again with the "tool", "command", and "parameters" arguments.

{toolsJson}
{_cachedToolListsJson[tool]}
Next, identify the tool you want to learn about and run again with the "learn" argument and the "tool" name to get a list of available commands and their parameters.

{toolsJson}
{_cachedRootToolsJson}
Comment on lines 286 to 290
Text = """
The "command" parameters are required when not learning
The "command" parameter is required when not learning.
Run again with the "learn" argument to get a list of available tools and their parameters.
To learn about a specific tool, use the "tool" argument with the name of the tool.
To learn about a specific tool, use the "command" argument with the name of the tool.
"""
if (SupportsSampling(request.Server) && !string.IsNullOrWhiteSpace(intent))
if (request.Server.ClientCapabilities?.Sampling != null && !string.IsNullOrWhiteSpace(intent))
{
var availableTools = await GetChildToolListAsync(request, tool, cancellationToken);
@conniey conniey closed this Jul 1, 2026
@github-project-automation github-project-automation Bot moved this from Untriaged to Done in Azure MCP Server Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants