Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -449,7 +449,7 @@ public async Task<LogAnalysisResponse> AnalyzePipelineFailureLogs(string? projec
}
}

[McpServerTool, Description("Analyze azure pipeline for failures. Set analyzeWithAgent to false unless requested otherwise by the user")]
[McpServerTool(Name = "azsdk-analyze-pipeline"), Description("Analyze azure pipeline for failures. Set analyzeWithAgent to false unless requested otherwise by the user")]
public async Task<AnalyzePipelineResponse> AnalyzePipeline(int buildId, bool analyzeWithAgent, CancellationToken ct)
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private void Initialize()
buildClient = connection.GetClient<BuildHttpClient>();
}

[McpServerTool, Description("Downloads artifacts intended for LLM analysis from a pipeline run")]
[McpServerTool(Name = "azsdk-get-test-results"), Description("Downloads artifacts intended for LLM analysis from a pipeline run")]
public async Task<ObjectCommandResponse> GetPipelineLlmArtifacts(int buildId)
{
string project = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public override async Task HandleCommand(InvocationContext ctx, CancellationToke
await CleanupAgents(projectEndpoint, ct);
}

[McpServerTool, Description("Clean up AI agents in an AI foundry project. Leave projectEndpoint empty if not specified")]
[McpServerTool(Name = "azsdk-cleanup-ai-agents"), Description("Clean up AI agents in an AI foundry project. Leave projectEndpoint empty if not specified")]
public async Task CleanupAgents(string? projectEndpoint = null, CancellationToken ct = default)
{
try
Expand Down
10 changes: 5 additions & 5 deletions tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ExampleTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public override async Task HandleCommand(InvocationContext ctx, CancellationToke
output.Output(result);
}

[McpServerTool(Name = "example_azure_service"), Description("Demonstrates Azure service integration")]
[McpServerTool(Name = "azsdk-example-azure-service"), Description("Demonstrates Azure service integration")]
public async Task<ExampleServiceResponse> DemonstrateAzureService(string? tenantId = null, CancellationToken ct = default)
{
try
Expand Down Expand Up @@ -169,7 +169,7 @@ public async Task<ExampleServiceResponse> DemonstrateAzureService(string? tenant
}
}

[McpServerTool(Name = "example_devops_service"), Description("Demonstrates DevOps service integration")]
[McpServerTool(Name = "azsdk-example-devops-service"), Description("Demonstrates DevOps service integration")]
public async Task<ExampleServiceResponse> DemonstrateDevOpsService(string packageName, string language, CancellationToken ct = default)
{
try
Expand Down Expand Up @@ -201,7 +201,7 @@ public async Task<ExampleServiceResponse> DemonstrateDevOpsService(string packag
}
}

[McpServerTool(Name = "example_github_service"), Description("Demonstrates GitHub service integration")]
[McpServerTool(Name = "azsdk-example-github-service"), Description("Demonstrates GitHub service integration")]
public async Task<ExampleServiceResponse> DemonstrateGitHubService(CancellationToken ct = default)
{
try
Expand Down Expand Up @@ -235,7 +235,7 @@ public async Task<ExampleServiceResponse> DemonstrateGitHubService(CancellationT
}
}

[McpServerTool(Name = "example_ai_service"), Description("Demonstrates AI service integration using Azure OpenAI")]
[McpServerTool(Name = "azsdk-example-ai-service"), Description("Demonstrates AI service integration using Azure OpenAI")]
public async Task<ExampleServiceResponse> DemonstrateAIService(string userPrompt, CancellationToken ct = default)
{
var model = "gpt-4o";
Expand Down Expand Up @@ -277,7 +277,7 @@ public async Task<ExampleServiceResponse> DemonstrateAIService(string userPrompt
}
}

[McpServerTool(Name = "example_error_handling"), Description("Demonstrates error handling patterns in tools")]
[McpServerTool(Name = "azsdk-example-error-handling"), Description("Demonstrates error handling patterns in tools")]
public async Task<DefaultCommandResponse> DemonstrateErrorHandling(string scenario, bool forceFailure = false, CancellationToken ct = default)
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public override async Task HandleCommand(InvocationContext ctx, CancellationToke
await Task.CompletedTask;
}

[McpServerTool(Name = "hello-world-fail"), Description("Echoes the message back to the client with a failure")]
[McpServerTool(Name = "azsdk-hello-world-fail"), Description("Echoes the message back to the client with a failure")]
public DefaultCommandResponse EchoFail(string message)
{
try
Expand All @@ -83,7 +83,7 @@ public DefaultCommandResponse EchoFail(string message)
}
}

[McpServerTool(Name = "hello-world"), Description("Echoes the message back to the client")]
[McpServerTool(Name = "azsdk-hello-world"), Description("Echoes the message back to the client")]
public DefaultCommandResponse EchoSuccess(string message)
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public override async Task HandleCommand(InvocationContext ctx, CancellationToke
}
}

[McpServerTool, Description("Analyzes a log file for errors and issues")]
[McpServerTool(Name = "azsdk-analyze-log-file"), Description("Analyzes a log file for errors and issues")]
public async Task<LogAnalysisResponse> AnalyzeLogFile(string filePath, bool fullSearch = false, List<string> customKeywords = null, int contextLines = -1)
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public override async Task HandleCommand(InvocationContext ctx, CancellationToke
output.Output(result);
}

[McpServerTool, Description("Downloads files from a GitHub repository to a local directory, or from provided file paths")]
[McpServerTool(Name = "azsdk-download-files-from-github"), Description("Downloads files from a GitHub repository to a local directory, or from provided file paths")]
public async Task<DownloadResponse> DownloadPrompts(
string sourceRepoOwner,
string sourceRepoName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public override async Task HandleCommand(InvocationContext ctx, CancellationToke
output.Output(result);
}

[McpServerTool, Description("Validates whether the current workspace has all the files from a source repository (defaults to Azure/azure-rest-api-specs)")]
[McpServerTool(Name = "azsdk-validate-files"), Description("Validates whether the current workspace has all the files from a source repository (defaults to Azure/azure-rest-api-specs)")]
public async Task<ValidationResponse> ValidateWorkspaceFiles(
string sourceRepoOwner,
string sourceRepoName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public partial class ReleasePlanTool(IDevOpsService devOpsService, ITypeSpecHelp
private static partial Regex NameSpaceIssueUrlRegex();


[McpServerTool, Description("Get release plan for API spec pull request. This tool should be used only if work item Id is unknown.")]
[McpServerTool(Name = "azsdk-get-release-plan-for-pull-request"), Description("Get release plan for API spec pull request. This tool should be used only if work item Id is unknown.")]
public async Task<string> GetReleasePlanForPullRequest(string pullRequestLink)
{
try
Expand Down Expand Up @@ -126,7 +126,7 @@ public override async Task HandleCommand(InvocationContext ctx, CancellationToke
}
}

[McpServerTool, Description("Get Release Plan: Get release plan work item details for a given work item id or release plan Id.")]
[McpServerTool(Name = "azsdk-get-release-plan"), Description("Get Release Plan: Get release plan work item details for a given work item id or release plan Id.")]
public async Task<string> GetReleasePlan(int workItem = 0, int releasePlanId = 0)
{
try
Expand Down Expand Up @@ -196,7 +196,7 @@ Please create a pull request in the public Azure/azure-rest-api-specs repository
}
}

[McpServerTool, Description("Create Release Plan work item.")]
[McpServerTool(Name = "azsdk-create-release-plan"), Description("Create Release Plan work item.")]
public async Task<string> CreateReleasePlan(string typeSpecProjectPath, string targetReleaseMonthYear, string serviceTreeId, string productTreeId, string specApiVersion, string specPullRequestUrl, string sdkReleaseType, string userEmail = "", bool isTestReleasePlan = false)
{
try
Expand Down Expand Up @@ -255,7 +255,7 @@ public async Task<string> CreateReleasePlan(string typeSpecProjectPath, string t
}
}

[McpServerTool, Description("Update the SDK details in the release plan work item. This tool is called to update SDK language and package name in the release plan work item." +
[McpServerTool(Name = "azsdk-update-sdk-details-in-release-plan"), Description("Update the SDK details in the release plan work item. This tool is called to update SDK language and package name in the release plan work item." +
" sdkDetails parameter is a JSON of list of SDKInfo and each SDKInfo contains Language and PackageName as properties.")]
public async Task<string> UpdateSDKDetailsInReleasePlan(int releasePlanWorkItemId, string sdkDetails)
{
Expand Down Expand Up @@ -308,7 +308,7 @@ public async Task<string> UpdateSDKDetailsInReleasePlan(int releasePlanWorkItemI
}
}

[McpServerTool, Description("Link package namespace approval issue to release plan(required only for management plan). This requires GitHub issue URL for the namespace approval request and release plan work item id.")]
[McpServerTool(Name = "azsdk-link-namespace-approval-issue"), Description("Link package namespace approval issue to release plan(required only for management plan). This requires GitHub issue URL for the namespace approval request and release plan work item id.")]
public async Task<string> LinkNamespaceApprovalIssue(int releasePlanWorkItemId, string namespaceApprovalIssue)
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async override Task HandleCommand(InvocationContext ctx, CancellationToke
output.Output(result);
}

[McpServerTool(Name = "CheckPackageReleaseReadiness"), Description("Checks if SDK package is ready to release (release readiness). This includes checking pipeline status, apiview status, change log status, and namespace approval status.")]
[McpServerTool(Name = "azsdk-check-package-release-readiness"), Description("Checks if SDK package is ready to release (release readiness). This includes checking pipeline status, apiview status, change log status, and namespace approval status.")]
public async Task<PackageResponse> CheckPackageReleaseReadinessAsync(string packageName, string language)
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public async override Task HandleCommand(InvocationContext ctx, CancellationToke
output.Output(result);
}

[McpServerTool(Name = "ReleaseSdkPackage"), Description("Releases the specified SDK package for a language. This includes checking if the package is ready for release and triggering the release pipeline. This tool calls CheckPackageReleaseReadiness")]
[McpServerTool(Name = "azsdk-release-sdk-package"), Description("Releases the specified SDK package for a language. This includes checking if the package is ready for release and triggering the release pipeline. This tool calls CheckPackageReleaseReadiness")]
public async Task<SdkReleaseResponse> ReleasePackageAsync(string packageName, string language, string branch = "main")
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class SpecCommonTools(IGitHelper gitHelper, ILogger<SpecCommonTools> logg
private readonly Option<string> repoRootOpt = new(["--repo-root"], "Path to azure-rest-api-spec repo root") { IsRequired = true };
private readonly Option<string> targetBranchOpt = new(["--target-branch"], () => "main", "Target branch to compare the changes") { IsRequired = true };

[McpServerTool, Description("This tool returns list of TypeSpec projects modified in current branch")]
[McpServerTool(Name = "azsdk-get-modified-typespec-projects"), Description("This tool returns list of TypeSpec projects modified in current branch")]
public string GetModifiedTypeSpecProjects(string repoRootPath, string targetBranch = "main")
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class SpecPullRequestTools(
private readonly Option<string> repoNameOpt = new(["--repo-name"], () => "azure-rest-api-specs", "GitHub repo name") { IsRequired = false };


[McpServerTool, Description("Connect to GitHub using personal access token.")]
[McpServerTool(Name = "azsdk-connect-to-github"), Description("Connect to GitHub using personal access token.")]
public async Task<string> GetGitHubUserDetails()
{
try
Expand All @@ -61,7 +61,7 @@ public async Task<string> GetGitHubUserDetails()

}

[McpServerTool, Description("Check if TypeSpec project is in public repo. Provide absolute path to TypeSpec project root as param.")]
[McpServerTool(Name = "azsdk-check-typespec-project-in-public-repo"), Description("Check if TypeSpec project is in public repo. Provide absolute path to TypeSpec project root as param.")]
public string CheckIfSpecInPublicRepo(string typeSpecProjectPath)
{
try
Expand All @@ -77,7 +77,7 @@ public string CheckIfSpecInPublicRepo(string typeSpecProjectPath)
}
}

[McpServerTool, Description("Get pull request link for current branch in the repo. Provide absolute path to TypeSpec project root as param. This tool call GetPullRequest to get pull request details.")]
[McpServerTool(Name = "azsdk-get-pull-request-link-for-current-branch"), Description("Get pull request link for current branch in the repo. Provide absolute path to TypeSpec project root as param. This tool call GetPullRequest to get pull request details.")]
public async Task<string> GetPullRequestForCurrentBranch(string typeSpecProjectPath)
{
try
Expand Down Expand Up @@ -114,7 +114,7 @@ public async Task<string> GetPullRequestForCurrentBranch(string typeSpecProjectP
}
}

[McpServerTool, Description("Create pull request for repository changes. Provide title, description and path to repository root. Creates a pull request for committed changes in the current branch.")]
[McpServerTool(Name = "azsdk-create-pull-request"), Description("Create pull request for repository changes. Provide title, description and path to repository root. Creates a pull request for committed changes in the current branch.")]
public async Task<List<string>> CreatePullRequest(string title, string description, string repoPath, string targetBranch = "main", bool draft = true)
{
try
Expand Down Expand Up @@ -172,7 +172,7 @@ private async Task<List<string>> GetPullRequestCommentsAsync(int pullRequestNumb
}


[McpServerTool, Description("This tool gets pull request details, status, comments, checks, next action details, links to APIView reviews.")]
[McpServerTool(Name = "azsdk-get-pull-request"), Description("This tool gets pull request details, status, comments, checks, next action details, links to APIView reviews.")]
public async Task<string> GetPullRequest(int pullRequestNumber, string repoOwner = "Azure", string repoName = "azure-rest-api-specs")
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class SpecValidationTools(ITypeSpecHelper typeSpecHelper, ILogger<SpecVal
/// Validates the TypeSpec API specification.
/// </summary>
/// <param name="typeSpecProjectRootPath">The root path of the TypeSpec project.</param>
[McpServerTool, Description("Run TypeSpec validation. Provide absolute path to TypeSpec project root as param. This tool runs TypeSpec validation and TypeSpec configuration validation.")]
[McpServerTool(Name = "azsdk-run-typespec-validation"), Description("Run TypeSpec validation. Provide absolute path to TypeSpec project root as param. This tool runs TypeSpec validation and TypeSpec configuration validation.")]
public IList<string> RunTypeSpecValidation(string typeSpecProjectRootPath)
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private async Task<GenericResponse> IsSdkDetailsPresentInReleasePlanAsync(int wo
}
// disabling analyzer warning for MCP001 because the called function is in an entire try/catch block.
#pragma warning disable MCP001
[McpServerTool, Description("Checks whether a TypeSpec API spec is ready to generate SDK. Provide a pull request number and path to TypeSpec project json as params.")]
[McpServerTool(Name = "azsdk-check-api-spec-ready-for-sdk"), Description("Checks whether a TypeSpec API spec is ready to generate SDK. Provide a pull request number and path to TypeSpec project json as params.")]
public async Task<string> CheckApiReadyForSDKGeneration(string typeSpecProjectRoot, int pullRequestNumber, int workItemId = 0)
#pragma warning restore MCP001
{
Expand Down Expand Up @@ -310,7 +310,7 @@ public async Task<string> RunGenerateSdkAsync(string typespecProjectRoot, string
/// </summary>
/// <param name="buildId">Build ID for the pipeline run</param>
/// <returns></returns>
[McpServerTool, Description("Get SDK generation pipeline or release pipeline details and status for a given pipeline build ID")]
[McpServerTool(Name = "azsdk-get-pipeline-status"), Description("Get SDK generation pipeline or release pipeline details and status for a given pipeline build ID")]
public async Task<string> GetPipelineRunStatus(int buildId)
{

Expand Down Expand Up @@ -341,7 +341,7 @@ public async Task<string> GetPipelineRunStatus(int buildId)
/// <param name="buildId">Build ID for the pipeline run</param>
/// <param name="workItemId">Work item ID for the release plan</param>
/// <returns></returns>
[McpServerTool, Description("Get SDK pull request link from SDK generation pipeline run or from work item. Build ID of pipeline run is required to query pull request link from SDK generation pipeline. This tool can get SDK pull request details if present in a work item.")]
[McpServerTool(Name = "azsdk-get-sdk-pull-request-link"), Description("Get SDK pull request link from SDK generation pipeline run or from work item. Build ID of pipeline run is required to query pull request link from SDK generation pipeline. This tool can get SDK pull request details if present in a work item.")]
public async Task<string> GetSDKPullRequestDetails(string language, int workItemId, int buildId = 0)
{
try
Expand Down Expand Up @@ -418,7 +418,7 @@ private static string GetRepoName(string language)
};
}

[McpServerTool, Description("Link SDK pull request to release plan work item")]
[McpServerTool(Name = "azsdk-link-sdk-pull-request-to-release-plan"), Description("Link SDK pull request to release plan work item")]
public async Task<string> LinkSdkPullRequestToReleasePlan(string language, string pullRequestUrl, int workItemId = 0, int releasePlanId = 0)
{
try
Expand Down
Loading