Migrate Search tools to new tool design#2954
Open
alzimmermsft wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the Azure Search toolset commands from explicit RegisterOptions/BindOptions(ParseResult) patterns to the newer attribute-based options model (Options POCO + [Option]/[OptionContainer]), aligning Search commands with the newer command base classes and reducing direct System.CommandLine usage in the toolset.
Changes:
- Converted Search commands to the new
AuthenticatedCommand<TOptions, TResult>/SubscriptionCommand<TOptions, TResult>style with Options POCO binding. - Replaced legacy option definition classes/base option types with
[Option]-attributed options and a newSearchOptionDescriptionsconstants holder. - Simplified toolset dependencies (e.g., removed explicit
System.CommandLinepackage reference) and adjusted tests/service construction accordingly.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Service/ServiceListCommandTests.cs | Updates test base class to match new subscription command shape. |
| tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Service/SearchServiceTests.cs | Updates service instantiation after constructor signature change. |
| tools/Azure.Mcp.Tools.Search/src/Services/SearchService.cs | Removes logger dependency and updates usings for System.Text.Json. |
| tools/Azure.Mcp.Tools.Search/src/Services/ISearchService.cs | Adds System.Text.Json import for JsonElement return types. |
| tools/Azure.Mcp.Tools.Search/src/Options/Service/ServiceListOptions.cs | Converts subscription options to [Option] attributes + ISubscriptionOption. |
| tools/Azure.Mcp.Tools.Search/src/Options/SearchOptionDescriptions.cs | Adds centralized option description constants for Search options. |
| tools/Azure.Mcp.Tools.Search/src/Options/SearchOptionDefinitions.cs | Removes legacy System.CommandLine-based option definitions. |
| tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeSourceGetOptions.cs | Converts options to [Option] attribute model. |
| tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeBaseRetrieveOptions.cs | Converts options to [Option] attribute model (query/messages/service/retry). |
| tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeBaseGetOptions.cs | Converts options to [Option] attribute model. |
| tools/Azure.Mcp.Tools.Search/src/Options/Index/IndexQueryOptions.cs | Converts options to [Option] attribute model. |
| tools/Azure.Mcp.Tools.Search/src/Options/Index/IndexGetOptions.cs | Converts options to [Option] attribute model. |
| tools/Azure.Mcp.Tools.Search/src/Options/Index/BaseIndexOptions.cs | Removes obsolete base options type. |
| tools/Azure.Mcp.Tools.Search/src/Options/BaseSearchOptions.cs | Removes obsolete base options type. |
| tools/Azure.Mcp.Tools.Search/src/Models/IndexInfo.cs | Removes explicit JSON property annotations (rely on serializer naming policy). |
| tools/Azure.Mcp.Tools.Search/src/Models/FieldInfo.cs | Removes explicit JSON property annotations (rely on serializer naming policy). |
| tools/Azure.Mcp.Tools.Search/src/GlobalUsings.cs | Removes global usings no longer needed after migration. |
| tools/Azure.Mcp.Tools.Search/src/Commands/Service/ServiceListCommand.cs | Migrates to SubscriptionCommand<TOptions, TResult> and options binding model. |
| tools/Azure.Mcp.Tools.Search/src/Commands/SearchJsonContext.cs | Simplifies source-gen context declaration. |
| tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeSourceGetCommand.cs | Migrates to AuthenticatedCommand<TOptions, TResult> + options binding model. |
| tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeBaseRetrieveCommand.cs | Migrates to AuthenticatedCommand<TOptions, TResult> and moves validation into ValidateOptions. |
| tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeBaseGetCommand.cs | Migrates to AuthenticatedCommand<TOptions, TResult> + options binding model. |
| tools/Azure.Mcp.Tools.Search/src/Commands/Index/IndexQueryCommand.cs | Migrates to AuthenticatedCommand<TOptions, TResult> and updates result type. |
| tools/Azure.Mcp.Tools.Search/src/Commands/Index/IndexGetCommand.cs | Migrates to AuthenticatedCommand<TOptions, TResult> + options binding model. |
| tools/Azure.Mcp.Tools.Search/src/Azure.Mcp.Tools.Search.csproj | Updates core ProjectReference path and removes System.CommandLine PackageReference. |
| servers/Azure.Mcp.Server/changelog-entries/1782416793886.yaml | Adds changelog entry indicating breaking changes for Search tools. |
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?
Migrates Search tools to new design where Register and Bind options are based on
Optionattributes.GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline