Fixes invalid telemetry tag for ToolArea#346
Merged
conniey merged 14 commits intomicrosoft:mainfrom Sep 8, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a telemetry issue where the ToolArea tag would incorrectly fall back to using the tool name when the area could not be found, resulting in misleading telemetry data. The fix implements a direct mapping approach from tool names to area setups and returns null when the area cannot be determined.
- Updated the
CommandFactoryto maintain a direct mapping from command names to their correspondingIAreaSetupobjects - Modified the telemetry logic to avoid fallback to tool name when area lookup fails
- Added comprehensive test coverage for the new functionality
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| CommandFactory.cs | Implements direct mapping from command names to areas and refactors area lookup logic |
| CommandFactoryToolLoader.cs | Removes fallback logic that used tool name when area lookup failed |
| CommandFactoryTests.cs | Adds extensive test coverage for area lookup and command dictionary creation |
| McpRuntimeTests.cs | Adds test to verify activity tags are properly set during tool execution |
| CommandTestsBase.cs | Adds overloaded method to support testing with different MCP clients |
| CommandTests.cs | Adds integration test to verify tool functionality across different server modes |
… than using tokenized name.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
0a06226 to
eca3d76
Compare
sandeep-sen
approved these changes
Sep 8, 2025
jongio
approved these changes
Sep 8, 2025
joshfree
reviewed
Sep 8, 2025
joshfree
approved these changes
Sep 8, 2025
colbytimm
pushed a commit
to colbytimm/microsoft-mcp
that referenced
this pull request
Sep 27, 2025
* use full toolname when finding area. * Add overload to use an mcp client to call. * Add test for invocation of tool * Keep track of command names by IAreaSetup to find Service Area rather than using tokenized name. * Fix an add tests for CommandFactory. * Add test to verify subscription guid and status. * Update CHANGELOG. * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix Typo. * Move null-overriding. * Fix Name normalization with sys commandline * Fix test assertions from merged upstream * Fix whitespace * Revert change to command test --------- 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.

What does this PR do?
ToolAreatag would be filled in withToolNameif area could not be found. Sets result tonullso misleading information is not sent.GitHub issue number?
Fixees: https://github.com/Azure/azure-mcp-pr/issues/355
Pre-merge Checklist
servers/Azure.Mcp.Server/CHANGELOG.mdand/orservers/Fabric.Mcp.Server/CHANGELOG.mdfor product changes (features, bug fixes, UI/UX, updated dependencies)servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentation/docs/azmcp-commands.mdand/or/docs/fabric-commands.mdToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test prompts/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline