Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public override async ValueTask<CallToolResult> CallToolHandler(RequestContext<C
{
var content = new TextContentBlock
{
Text = $"The tool {request.Params.Name} was not found",
Text = $"The tool {request.Params.Name} was not found in the tool registry.",
};

_logger.LogWarning(content.Text);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ Run again with the "learn" argument to get a list of available tools and their p
};
}

/// <summary>
/// Gets all of the <see cref="IAreaSetup"/>'s available in the server.
/// </summary>
/// <returns>A JSON serialized string with each area's name and a description of operations available in
/// that namespace.</returns>
private async Task<string> GetRootToolsJsonAsync()
{
if (_cachedRootToolsJson != null)
Expand All @@ -187,6 +192,12 @@ private async Task<string> GetRootToolsJsonAsync()
return toolsJson;
}

/// <summary>
/// Gets the set of <see cref="Core.Commands.IBaseCommand"/> within an <see cref="IAreaSetup">.
/// </summary>
/// <param name="request">Calling request</param>
/// <param name="tool">Name of the <see cref="IAreaSetup"/> to get commands for.</param>
/// <returns>JSON serialized string representing the list of commands available in the tool's area.</returns>
private async Task<string> GetToolListJsonAsync(RequestContext<CallToolRequestParams> request, string tool)
{
if (_cachedToolListsJson.TryGetValue(tool, out var cachedJson))
Expand Down Expand Up @@ -236,7 +247,10 @@ Here are the available list of tools.

private async Task<CallToolResult> ToolLearnModeAsync(RequestContext<CallToolRequestParams> request, string intent, string tool, CancellationToken cancellationToken)
{
Activity.Current?.SetTag(TagName.IsServerCommandInvoked, false);
var activity = Activity.Current?
.SetTag(TagName.IsServerCommandInvoked, false)
.SetTag(TagName.ToolArea, tool);

var toolsJson = await GetToolListJsonAsync(request, tool);
if (string.IsNullOrEmpty(toolsJson))
{
Expand Down Expand Up @@ -273,7 +287,6 @@ private async Task<CallToolResult> ToolLearnModeAsync(RequestContext<CallToolReq

private async Task<CallToolResult> CommandModeAsync(RequestContext<CallToolRequestParams> request, string intent, string tool, string command, Dictionary<string, object?> parameters, CancellationToken cancellationToken)
{
Activity.Current?.SetTag(TagName.IsServerCommandInvoked, true);
McpClient? client;

try
Expand All @@ -292,6 +305,14 @@ private async Task<CallToolResult> CommandModeAsync(RequestContext<CallToolReque
return await RootLearnModeAsync(request, intent, cancellationToken);
}

var activity = Activity.Current;
if (activity != null)
{
activity.SetTag(TagName.IsServerCommandInvoked, true)
.SetTag(TagName.ToolArea, tool)
.SetTag(TagName.ToolName, command);
}

try
{
await NotifyProgressAsync(request, $"Calling {tool} {command}...", cancellationToken);
Expand Down
4 changes: 3 additions & 1 deletion servers/Azure.Mcp.Server/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The Azure MCP Server updates automatically by default whenever a new release com

### Other Changes

- Set telemetry fields for `ToolArea` and `ToolName` when "single" mode is used. [[#952](https://github.com/microsoft/mcp/pull/952)]

## 0.9.8 (2025-10-23)

### Features Added
Expand All @@ -25,7 +27,7 @@ The Azure MCP Server updates automatically by default whenever a new release com

### Other Changes

- Set telemetry field's for `ToolArea` and `ToolName` when "consolidated" mode is used or a server is loaded from `registry.json`. [[#933](https://github.com/microsoft/mcp/pull/933)]
- Set telemetry fields for `ToolArea` and `ToolName` when "consolidated" mode is used or a server is loaded from `registry.json`. [[#933](https://github.com/microsoft/mcp/pull/933)]
- Added instructions on when to not use azd init [[#942](https://github.com/microsoft/mcp/pull/942)]

## 0.9.7 (2025-10-22)
Expand Down