Skip to content

Add IsServerCommandInvoked telemetry tag#751

Merged
conniey merged 9 commits intomicrosoft:mainfrom
conniey:add-indicator-for-command
Oct 13, 2025
Merged

Add IsServerCommandInvoked telemetry tag#751
conniey merged 9 commits intomicrosoft:mainfrom
conniey:add-indicator-for-command

Conversation

@conniey
Copy link
Copy Markdown
Member

@conniey conniey commented Oct 9, 2025

What does this PR do?

Adds a new tag, IsServerCommandInvoked indicating that the tool call resulted in a command being invoked. Set to false when learning or finding new servers.

GitHub issue number?

Fixes https://github.com/microsoft/mcp-pr/issues/124

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
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • 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
    • Updated command list in /servers/Azure.Mcp.Server/docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • 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 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 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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds a new telemetry tag IsServerCommandInvoked to track whether a tool call resulted in an actual command execution or was used for learning/discovery purposes. The tag is set to true by default when a tool is called and explicitly set to false in learning modes where commands aren't actually invoked.

Key changes:

  • Adds the IsServerCommandInvoked tag to telemetry constants
  • Sets the tag to false in learning/discovery scenarios across tool loaders
  • Updates tests to verify the new tag behavior

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
TelemetryConstants.cs Adds the new IsCommandInvoked constant for the telemetry tag
McpRuntime.cs Sets default value of true for the new tag when tools are called
SingleProxyToolLoader.cs Sets tag to false in learning modes where no actual command is invoked
ServerToolLoader.cs Sets tag to false in tool learning scenarios
NamespaceToolLoader.cs Sets tag to false in tool learning scenarios
McpRuntimeTests.cs Updates test helpers and adds assertions for the new tag behavior

@conniey conniey changed the title Add IsServerCommandInvoked Add IsServerCommandInvoked telemetry tag Oct 9, 2025
@joshfree joshfree moved this from Untriaged to Not Started in Azure MCP Server Oct 12, 2025
@joshfree joshfree added this to the 2025-10 milestone Oct 12, 2025
Comment thread core/Azure.Mcp.Core/src/Services/Telemetry/TelemetryConstants.cs Outdated
conniey and others added 7 commits October 13, 2025 10:58
…r/Commands/Runtime/McpRuntimeTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…r/Commands/Runtime/McpRuntimeTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…r/Commands/Runtime/McpRuntimeTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@conniey conniey force-pushed the add-indicator-for-command branch from 5d4067f to e19df8c Compare October 13, 2025 16:00
@github-project-automation github-project-automation Bot moved this from Not Started to In Progress in Azure MCP Server Oct 13, 2025
@conniey conniey merged commit b764a65 into microsoft:main Oct 13, 2025
26 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Azure MCP Server Oct 13, 2025
@conniey conniey deleted the add-indicator-for-command branch October 13, 2025 16:58
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Dec 8, 2025
* Add IsServerCommandInvoked

* Add tests

* Update CHANGELOG

* Update core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/Areas/Server/Commands/Runtime/McpRuntimeTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/Areas/Server/Commands/Runtime/McpRuntimeTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/Areas/Server/Commands/Runtime/McpRuntimeTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Run dotnet format.

* Aggregate to a single line.

* Rename constant.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants