-
Notifications
You must be signed in to change notification settings - Fork 578
Normalize command result payloads to object roots #3165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vcolin7
wants to merge
15
commits into
microsoft:main
Choose a base branch
from
vcolin7:vcolin7-normalize-result-shapes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
3f6f3db
Normalize guidance command result roots
vcolin7 77178df
Normalize query and template result roots
vcolin7 a67667c
Consolidate tool list result variants
vcolin7 97dff80
Wrap monitor command result roots
vcolin7 f9ba804
Wrap Fabric docs result payloads
vcolin7 0897aea
Wrap OneLake command result payloads
vcolin7 ecb6e15
Document result shape changes
vcolin7 42deedb
Preserve Functions result model names
vcolin7 e9ec273
Omit empty role continuation fields
vcolin7 9aaa7b6
Simplify workspace log result test
vcolin7 338439f
Simplify resource log result test
vcolin7 ad2742f
Updated changelogs
vcolin7 4d66c8f
Update playback result assertions
vcolin7 15f190c
Update tools list consumers
vcolin7 cff857a
Merge origin/main into vcolin7-normalize-result-shapes
vcolin7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
9 changes: 9 additions & 0 deletions
9
eng/tools/ToolDescriptionEvaluator/src/Models/ListToolsPayload.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace ToolSelection.Models; | ||
|
|
||
| public sealed record ListToolsPayload( | ||
| [property: JsonPropertyName("commands")] List<Tool>? Commands); |
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
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
36 changes: 36 additions & 0 deletions
36
.../ToolMetadataExporter/tests/ToolMetadataExporter.UnitTests/Models/ListToolsResultTests.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System.Text.Json; | ||
| using ToolSelection.Models; | ||
| using Xunit; | ||
|
|
||
| namespace ToolMetadataExporter.UnitTests.Models; | ||
|
|
||
| public class ListToolsResultTests | ||
| { | ||
| [Fact] | ||
| public void Deserialize_ReadsCommandsFromObjectRoot() | ||
| { | ||
| const string json = """ | ||
| { | ||
| "status": 200, | ||
| "results": { | ||
| "commands": [ | ||
| { | ||
| "name": "list", | ||
| "command": "tools list" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| """; | ||
|
|
||
| var result = Assert.IsType<ListToolsResult>( | ||
| JsonSerializer.Deserialize(json, SourceGenerationContext.Default.ListToolsResult)); | ||
| var tool = Assert.Single(Assert.IsType<List<Tool>>(result.Tools)); | ||
|
|
||
| Assert.Equal("list", tool.Name); | ||
| Assert.Equal("tools list", tool.Command); | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
servers/Azure.Mcp.Server/changelog-entries/1784946361604.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| changes: | ||
| - section: "Breaking Changes" | ||
| description: | | ||
| Normalized result payloads for the following tools: | ||
| - `tools list` now returns either `{ commands }` or `{ names }`, omitting the inactive field. | ||
| - `advisor recommendation apply` now returns the resulting rules in a `{ rules }` object. | ||
| - `azurebestpractices get`, `azurebestpractices ai_app`, and `azureterraformbestpractices get` now return the resulting best practices in a `{ bestPractices }` object. | ||
| - `functions language list` and `functions project get` now return the resulting singleton values as direct objects. | ||
| - `monitor healthmodels list` now returns the resulting health models in a `{ healthModels }` object. | ||
| - `monitor resource log query` and `monitor workspace log query` now return the resulting rows in a `{ results }` object. | ||
| - `monitor instrumentation orchestrator-start`, `orchestrator-next`, `send-brownfield-analysis`, and `send-enhancement-select` now return the resulting scalar value in a `{ result }` object. | ||
| - `search index query` now returns the resulting rows in a `{ results }` object. | ||
| - `sql server get` now returns the resulting servers in a `{ servers }` object. | ||
| - `wellarchitectedframework serviceguide get` now returns the resulting guidance in a `{ guidance }` object. |
12 changes: 12 additions & 0 deletions
12
servers/Fabric.Mcp.Server/changelog-entries/1784946362379.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| changes: | ||
| - section: "Breaking Changes" | ||
| description: | | ||
| Normalized result payloads for the following tools: | ||
| - `docs best-practices` now returns the resulting best practices in a `{ bestPractices }` object. | ||
| - `docs item-definitions` now returns the resulting definition string in a `{ definition }` object. | ||
| - `docs platform-api-spec` and `docs workload-api-spec` now return the produced public API in a `{ publicApi }` object. | ||
| - `onelake create or update data access role` and `onelake get data access role` now return the produced roles in a `{ roles }` object. | ||
| - `onelake list data access roles` now returns `{ roles }` instead of `{ value }`. | ||
| - `onelake get settings` now returns the produced settings in a `{ settings }` object. | ||
| - `onelake create shortcut` and `onelake get shortcut` now return the produced shortcut in a `{ shortcut }` object. | ||
| - `onelake list shortcuts` now returns `{ shortcuts }` instead of `{ value }`. |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change on the JSON response shape. I'm fine with it overall, but we are changing the response for
azmcp tools list, which will break a lot of CLI usage. This is changing tool listing from:[ {tool}, {tool}, ... ]to
{ "Commands": [ {tool}, {tool}, ... ] }