[Draft] Add Azure.Mcp.Tools.SreAgent (scaffolding for issue #2541)#2611
[Draft] Add Azure.Mcp.Tools.SreAgent (scaffolding for issue #2541)#2611BandaruDheeraj wants to merge 10 commits intomainfrom
Conversation
Adds initial scaffolding for the Azure SRE Agent tool package per the standard Azure.Mcp.Tools.<Service> pattern. This is a draft introducing the area registration only; the full set of SRE Agent tools (agents, skills, connectors, threads, hooks, scheduled tasks, incidents, knowledge memory, documentation, workflows, architecture planning) will land as follow-up commits on this branch. Adds: - tools/Azure.Mcp.Tools.SreAgent/src/* (csproj, Setup, JsonContext, BaseCommand, Models, Options, Services skeleton, AgentsListCommand) - Registers SreAgentSetup() in servers/Azure.Mcp.Server/src/Program.cs RegisterAreas - Adds slnx folder + project entries in servers/Azure.Mcp.Server/Azure.Mcp.Server.slnx Tracking issue: #2541 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
BaseAzureService.ValidateRequiredParameters expects (string name, string? value) tuples, not bare strings. Local build now green against SDK 10.0.203. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SreAgentService now extends BaseAzureResourceService and queries Azure Resource Graph for Microsoft.App/SREAgentPreview resources. ListAgentsAsync returns real data including the per-agent data-plane endpoint (properties.endpoint, with properties.fqdn fallback for older preview API versions). Adds CallDataPlaneAsync helper that mints a bearer token for the SRE Agent data-plane audience (https://azuresre.dev/.default — same audience the existing .NET CLI in the SRE Agent runtime repo uses) and forwards the request to https://*.azuresre.ai. This is the foundation that the remaining 29 commands across 11 tool groups (Threads, Connectors, Hooks, Skills, Incidents, ScheduledTasks, Docs, Workflows, Architecture, etc.) will call into. Full Azure.Mcp.Server build succeeds with the new package included via the existing tools/Azure.*/src/*.csproj wildcard. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…mmands Ports the SRE Agent Node MCP server tools agents.ts, create-agent-tool.ts, get-agent-tool.ts, skills.ts to C# commands. Each command resolves the per-agent data-plane endpoint via ARM (ListAgentsAsync) and calls the SRE Agent REST API via SreAgentService.CallDataPlaneAsync. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ds, ScheduledTasks, Incidents, Workflows, Docs, Architecture (~48 commands across 11 tool groups) Block-merged via #region (sub-agent X) markers from: - bandarud/sre-B-conn-hooks: Connectors + Hooks - bandarud/sre-C-threads-sched: Threads + ScheduledTasks - bandarud/sre-D-incidents-misc: Incidents + Workflows + Docs + Architecture All built on top of the spine (SreAgentService.CallDataPlaneAsync). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…G entries - New tests/Azure.Mcp.Tools.SreAgent.UnitTests project (xunit.v3 + NSubstitute) - AgentsListCommandTests covers constructor, validation, error handling, empty results, and resource group/tenant pass-through (6 passing tests) - Added SreAgent folders/projects to Microsoft.Mcp.slnx (alphabetically between Speech and Sql) - Added Azure SRE Agent section to servers/Azure.Mcp.Server/README.md with example prompts spanning all 11 tool groups - Added Azure SRE Agent entry to the supported services list - Added changelog-entries/bandarud-sreagent-tool.yml describing the new tool group Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@g2vinay this is now ready for review. Summary:
Implementation was fanned out across four sub-agent branches (A: agents+skills, B: connectors+hooks, C: threads+scheduledtasks, D: incidents+workflows+docs+architecture) and integrated via |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Azure MCP tool package, Azure.Mcp.Tools.SreAgent, wiring it into the Azure MCP Server and adding initial command surface area (agents/sub-agents, tools/skills, connectors, hooks, threads, scheduled tasks, incidents, workflows, docs, and architecture planning).
Changes:
- Added the
Azure.Mcp.Tools.SreAgenttool project with commands, options, models, JSON source-gen context, and anISreAgentService+ implementation for ARM discovery and SRE Agent data-plane calls. - Registered the new
sreagentarea inAzure.Mcp.Serverand updated solution (.slnx) entries accordingly. - Added server README examples and a changelog entry, plus a starter unit test project and tests for
agents list.
Invoking Livetests
Copilot submitted PRs are not trustworthy by default. Users with write access to the repo need to validate the contents of this PR before leaving a comment with the text /azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.
Reviewed changes
Copilot reviewed 126 out of 126 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.SreAgent/src/Azure.Mcp.Tools.SreAgent.csproj | New tool project (AOT-compatible) and dependencies. |
| tools/Azure.Mcp.Tools.SreAgent/src/AssemblyInfo.cs | InternalsVisibleTo for unit/live tests. |
| tools/Azure.Mcp.Tools.SreAgent/src/GlobalUsings.cs | Adds global usings for the tool project. |
| tools/Azure.Mcp.Tools.SreAgent/src/SreAgentSetup.cs | Registers DI services and builds the sreagent command tree. |
| tools/Azure.Mcp.Tools.SreAgent/src/Services/ISreAgentService.cs | Defines the service contract for ARM + data-plane operations. |
| tools/Azure.Mcp.Tools.SreAgent/src/Services/SreAgentService.cs | Implements ARM discovery + data-plane REST calls. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/BaseSreAgentCommand.cs | Base subscription-scoped command wiring (adds RG option binding). |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/SreAgentDataPlaneCommand.cs | Base for data-plane commands (binds --agent and resolves endpoint). |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/SreAgentCommandHelpers.cs | Shared helpers for endpoint resolution and JSON parsing. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/SreAgentPortedCommandHelpers.cs | Helper utilities for text results and JSON array extraction. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/SreAgentJsonContext.cs | System.Text.Json source-generation context for tool models/results. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Agents/AgentsListCommand.cs | Lists SRE Agent ARM resources in a subscription/RG. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Agents/AgentsGetCommand.cs | Gets a sub-agent definition from an SRE Agent resource. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Agents/AgentsCreateCommand.cs | Creates/updates a sub-agent on a targeted agent resource. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Agents/AgentsDeleteCommand.cs | Deletes a sub-agent (requires confirm). |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Agents/AgentsToolsGetCommand.cs | Gets a custom tool definition from a targeted agent resource. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Agents/AgentsToolsCreateCommand.cs | Creates/updates a custom tool definition on an agent resource. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Skills/AgentToolsListCommand.cs | Lists custom tools on a targeted agent resource. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Skills/SkillsListCommand.cs | Lists custom skills on a targeted agent resource. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Skills/SkillsCreateCommand.cs | Creates/updates a skill on a targeted agent resource. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Skills/SkillsDeleteCommand.cs | Deletes a tool/skill (requires confirm). |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Connectors/ConnectorsListCommand.cs | Lists connectors on a targeted agent resource. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Connectors/ConnectorsGetCommand.cs | Gets a connector’s details. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Connectors/ConnectorsCreateKustoCommand.cs | Creates/updates a Kusto connector. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Connectors/ConnectorsCreateMcpCommand.cs | Creates/updates an MCP connector (stdio/http). |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Connectors/ConnectorsDeleteCommand.cs | Deletes a connector. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Connectors/ConnectorsTestCommand.cs | Tests a connector and returns exposed tools. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Hooks/HooksListCommand.cs | Lists hooks on a targeted agent resource. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Hooks/HooksGetCommand.cs | Gets hook details. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Hooks/HooksDeleteCommand.cs | Deletes a hook. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Hooks/HooksThreadListCommand.cs | Lists hook activation state for a thread. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Hooks/HooksThreadActivateCommand.cs | Activates a thread hook. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Hooks/HooksThreadDeactivateCommand.cs | Deactivates a thread hook. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Threads/ThreadsCommandBase.cs | Shared thread polling/follow-up classification helpers. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Threads/ThreadsListCommand.cs | Lists SRE Agent threads. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Threads/ThreadsGetCommand.cs | Gets thread messages. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Threads/ThreadsCreateCommand.cs | Creates a thread and waits for initial completion. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Threads/ThreadsSendMessageCommand.cs | Sends a message and polls for completion. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Threads/ThreadsDeleteCommand.cs | Deletes a thread (requires confirm). |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Threads/ThreadsInvestigateCommand.cs | Starts an investigation loop with follow-up handling. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Threads/ThreadsInvestigateYoloCommand.cs | YOLO variant that auto-approves pending approvals. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/ScheduledTasks/ScheduledTasksListCommand.cs | Lists scheduled tasks. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/ScheduledTasks/ScheduledTasksGetCommand.cs | Gets a scheduled task. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/ScheduledTasks/ScheduledTasksCreateCommand.cs | Creates a scheduled task. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/ScheduledTasks/ScheduledTasksDeleteCommand.cs | Deletes a scheduled task (requires confirm). |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/ScheduledTasks/ScheduledTasksPauseCommand.cs | Pauses a scheduled task. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/ScheduledTasks/ScheduledTasksResumeCommand.cs | Resumes a scheduled task. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Incidents/IncidentsPlansListCommand.cs | Lists incident response plans (filters/handlers). |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Incidents/IncidentsPlansCreateCommand.cs | Creates and enables an incident response plan. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Incidents/IncidentsActiveListCommand.cs | Lists “incident-like” active threads. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Incidents/IncidentsCreateCommand.cs | Creates an incident investigation thread. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Incidents/IncidentsSetupPagerdutyCommand.cs | Creates PagerDuty connector from env var credentials. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Incidents/IncidentsSetupServicenowCommand.cs | Creates ServiceNow connector from env var credentials. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Workflows/WorkflowsGenerateCommand.cs | Generates agent/tool YAML scaffolding. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Workflows/WorkflowsValidateCommand.cs | Validates YAML content for common issues. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Workflows/WorkflowsApplyCommand.cs | Applies YAML to the data-plane API via minimal parsing. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Docs/DocsGetCommand.cs | Returns SRE Agent reference docs by topic. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Docs/MemoriesListCommand.cs | Lists knowledge base documents. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Docs/MemoriesSearchCommand.cs | Searches knowledge base documents. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Docs/MemoriesAddCommand.cs | Uploads markdown to knowledge base. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Docs/MemoriesDeleteCommand.cs | Deletes a knowledge base document (requires confirm). |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Docs/MemoriesReindexCommand.cs | Triggers knowledge base reindex. |
| tools/Azure.Mcp.Tools.SreAgent/src/Commands/Architecture/PlanCommand.cs | Produces an architecture plan based on requirements. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/BaseSreAgentOptions.cs | Base options including agent + subscription options. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/SreAgentOptionDefinitions.cs | Option definitions for the command line surface. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/SreAgentPortedOptionDefinitions.cs | Additional option definitions for “ported” command surface. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Agents/AgentsListOptions.cs | Options for agents list. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Agents/AgentsGetOptions.cs | Options for agents get. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Agents/AgentsCreateOptions.cs | Options for agents create. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Agents/AgentsDeleteOptions.cs | Options for agents delete. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Agents/AgentsToolsGetOptions.cs | Options for tools get. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Agents/AgentsToolsCreateOptions.cs | Options for tools create. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Skills/AgentToolsListOptions.cs | Options for tools list. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Skills/SkillsListOptions.cs | Options for skills list. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Skills/SkillsCreateOptions.cs | Options for skills create. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Skills/SkillsDeleteOptions.cs | Options for skills delete. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Connectors/ConnectorsListOptions.cs | Options for connectors list. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Connectors/ConnectorsGetOptions.cs | Options for connectors get. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Connectors/ConnectorsDeleteOptions.cs | Options for connectors delete. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Connectors/ConnectorsTestOptions.cs | Options for connectors test. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Connectors/ConnectorsCreateKustoOptions.cs | Options for connectors create-kusto. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Connectors/ConnectorsCreateMcpOptions.cs | Options for connectors create-mcp. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Hooks/HooksListOptions.cs | Options for hooks list. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Hooks/HooksGetOptions.cs | Options for hooks get. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Hooks/HooksDeleteOptions.cs | Options for hooks delete. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Hooks/HooksThreadListOptions.cs | Options for thread hook list. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Hooks/HooksThreadActivateOptions.cs | Options for thread hook activate. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Hooks/HooksThreadDeactivateOptions.cs | Options for thread hook deactivate. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Threads/ThreadsOptions.cs | Options for thread operations and investigations. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/ScheduledTasks/ScheduledTasksOptions.cs | Options for scheduled task operations. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Incidents/IncidentOptions.cs | Options for incident operations and connector setup. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Docs/DocsOptions.cs | Options for docs and knowledge base operations. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Workflows/WorkflowOptions.cs | Options for workflows generate/validate/apply. |
| tools/Azure.Mcp.Tools.SreAgent/src/Options/Architecture/PlanOptions.cs | Options for architecture planning. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreAgentResource.cs | Lightweight ARM projection model for SRE Agent resources. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreAgentDeleteResult.cs | Delete result model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreSubAgent.cs | Sub-agent model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreSubAgentProperties.cs | Sub-agent properties model (extension data supported). |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreSubAgentCreateRequest.cs | Sub-agent create request model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreAgentTool.cs | Custom tool model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreAgentToolProperties.cs | Custom tool properties model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreAgentToolParameter.cs | Tool parameter model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreAgentToolCreateRequest.cs | Tool create request model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreSkill.cs | Skill model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreSkillProperties.cs | Skill properties model (extension data supported). |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreSkillCreateRequest.cs | Skill create request model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/AgentConnector.cs | Connector model (incl. extended properties). |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/AgentConnectorEnvelope.cs | Connector envelope model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/ConnectorTestResult.cs | Connector test result model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/ConnectorToolInfo.cs | Connector tool info model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/HookEnvelope.cs | Hook envelope model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/HookSpec.cs | Hook spec/properties model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/HookDefinition.cs | Hook definition model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/ThreadHookInfo.cs | Thread hook info model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/ThreadHooksResponse.cs | Thread hooks response model. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreAgentThreadModels.cs | Thread/message/approval/user-question models. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreAgentScheduledTaskModels.cs | Scheduled task models. |
| tools/Azure.Mcp.Tools.SreAgent/src/Models/SreAgentPortedModels.cs | Additional models for incident/docs/memory surfaces. |
| tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.UnitTests/Azure.Mcp.Tools.SreAgent.UnitTests.csproj | New unit test project for SreAgent commands. |
| tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.UnitTests/AssemblyAttributes.cs | Test assembly-wide attributes. |
| tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.UnitTests/Agents/AgentsListCommandTests.cs | Unit tests for agents list command behavior. |
| servers/Azure.Mcp.Server/src/Program.cs | Registers SreAgentSetup in server area registration. |
| servers/Azure.Mcp.Server/README.md | Adds SRE Agent example prompts and service list entry. |
| servers/Azure.Mcp.Server/changelog-entries/bandarud-sreagent-tool.yml | Adds changelog entry for the new SRE Agent tool group. |
| servers/Azure.Mcp.Server/Azure.Mcp.Server.slnx | Adds SreAgent project folder and project reference. |
| Microsoft.Mcp.slnx | Adds SreAgent project + unit test project to root solution. |
|
|
||
| namespace Azure.Mcp.Tools.SreAgent.Options.Threads; | ||
|
|
||
| public class ThreadsListOptions : BaseSreAgentOptions; |
| public int TimeoutSeconds { get; set; } = 600; | ||
| } | ||
|
|
||
| public class ThreadsInvestigateYoloOptions : ThreadsInvestigateOptions; |
|
|
||
| namespace Azure.Mcp.Tools.SreAgent.Options.ScheduledTasks; | ||
|
|
||
| public class ScheduledTasksListOptions : BaseSreAgentOptions; |
|
|
||
| namespace Azure.Mcp.Tools.SreAgent.Options.Connectors; | ||
|
|
||
| public class ConnectorsListOptions : BaseSreAgentOptions; |
|
|
||
| namespace Azure.Mcp.Tools.SreAgent.Options.Hooks; | ||
|
|
||
| public class HooksListOptions : BaseSreAgentOptions; |
| private static (string? Kind, string? Name, string? Owner, JsonArray Tags, JsonObject Spec) ParseMinimalYaml(string yaml) | ||
| { | ||
| string? kind = null; string? name = null; string? owner = null; var tags = new JsonArray(); var spec = new JsonObject(); string? section = null; string? currentKey = null; var block = new List<string>(); | ||
| foreach (var rawLine in yaml.Replace("\r\n", "\n").Split('\n')) | ||
| { | ||
| var line = rawLine.TrimEnd(); var trimmed = line.Trim(); if (trimmed.Length == 0 || trimmed.StartsWith('#')) continue; | ||
| if (!char.IsWhiteSpace(line[0])) { FlushBlock(spec, ref currentKey, block); section = trimmed.TrimEnd(':'); if (trimmed.StartsWith("kind:", StringComparison.OrdinalIgnoreCase)) kind = Clean(trimmed[5..]); continue; } | ||
| if (section == "metadata") | ||
| { | ||
| if (trimmed.StartsWith("name:", StringComparison.OrdinalIgnoreCase)) name = Clean(trimmed[5..]); else if (trimmed.StartsWith("owner:", StringComparison.OrdinalIgnoreCase)) owner = Clean(trimmed[6..]); else if (trimmed.StartsWith("-")) tags.Add((JsonNode?)JsonValue.Create(Clean(trimmed[1..]))); | ||
| } | ||
| else if (section == "spec") | ||
| { | ||
| if (trimmed.StartsWith("-")) { if (currentKey is not null) block.Add(Clean(trimmed[1..])); continue; } | ||
| var colon = trimmed.IndexOf(':'); if (colon > 0) { FlushBlock(spec, ref currentKey, block); var key = trimmed[..colon].Trim(); var value = trimmed[(colon + 1)..].Trim(); if (value is "|" or "|-" or ">" or ">-") currentKey = key; else spec[key] = Clean(value); } else if (currentKey is not null) block.Add(trimmed); | ||
| } |
| @@ -0,0 +1,4 @@ | |||
| pr: 2611 | |||
| changes: | |||
| - section: "New Features" | |||
| pr: 2611 | ||
| changes: | ||
| - section: "New Features" | ||
| description: "Added Azure SRE Agent (`Microsoft.App/SREAgentPreview`) tool group with ~48 commands across 11 sub-groups: agents, skills, connectors, hooks, threads, scheduledtasks, incidents, workflows, docs, architecture, and memories. Supports listing/creating/updating SRE Agent resources, managing sub-agents and tools, registering data connectors (Kusto/MCP), configuring safety hooks, running investigations, scheduling tasks, declaring incidents, generating workflows, querying memories, and producing remediation plans against the SRE Agent data plane." |
| tools.AddCommand<AgentToolsListCommand>(serviceProvider); | ||
| tools.AddCommand<AgentsToolsGetCommand>(serviceProvider); | ||
| tools.AddCommand<AgentsToolsCreateCommand>(serviceProvider); | ||
| tools.AddCommand<SkillsDeleteCommand>(serviceProvider); | ||
|
|
| // Incidents + Workflows + Docs + Architecture (sub-agent D) | ||
| var incidents = new CommandGroup("incidents", "Incident response planning, connector setup, and active incident operations."); | ||
| var workflows = new CommandGroup("workflows", "Generate, validate, and apply SRE Agent workflow YAML."); | ||
| var docs = new CommandGroup("docs", "SRE Agent documentation and knowledge memory operations."); | ||
| var architecture = new CommandGroup("architecture", "SRE Agent architecture planning commands."); | ||
| sreAgent.AddSubGroup(incidents); | ||
| sreAgent.AddSubGroup(workflows); | ||
| sreAgent.AddSubGroup(docs); | ||
| sreAgent.AddSubGroup(architecture); | ||
|
|
||
| return sreAgent; |
jongio
left a comment
There was a problem hiding this comment.
A few items beyond the existing feedback:
HttpClient lifecycle - SreAgentService creates HTTP clients via TenantService.GetClient() (lines 101 and 714) instead of injecting IHttpClientFactory. The repo convention is to use IHttpClientFactory.CreateClient() for proper socket lifecycle management and recorded test support. This will block the recorded-test migration path.
Test coverage - Only AgentsListCommandTests exists. With ~48 commands across 11 subgroups, most commands have zero test coverage. Even basic Constructor_InitializesCommandCorrectly and BindOptions_BindsOptionsCorrectly tests per command would catch registration and option-binding bugs early.
Duplicate endpoint resolution - Both SreAgentDataPlaneCommand.ResolveEndpointAsync and SreAgentCommandHelpers.ResolveAgentEndpointAsync resolve an agent name to its data-plane endpoint URL. Pick one location and remove the other.
Formatting density - Several ported commands (e.g. IncidentsActiveListCommand, WorkflowsApplyCommand) cram entire method bodies onto single lines or collapse multi-statement blocks. This makes them very hard to review and maintain. Breaking these into standard multi-line formatting would help reviewers and future contributors.
| { | ||
| request.Content = new StringContent(jsonBody, Encoding.UTF8, "application/json"); | ||
| } | ||
|
|
There was a problem hiding this comment.
This creates an HttpClient directly instead of going through IHttpClientFactory. The repo convention (per recorded test docs) is to inject IHttpClientFactory into services and call CreateClient() so the test infrastructure can intercept and record/playback HTTP traffic. Same issue on line 714 with CallAgentDataPlaneAsync.
| ISreAgentService sreAgentService, | ||
| TOptions options, | ||
| CancellationToken cancellationToken) | ||
| { |
There was a problem hiding this comment.
ResolveEndpointAsync here duplicates SreAgentCommandHelpers.ResolveAgentEndpointAsync. Both call sreAgentService.GetAgentAsync and pull .Endpoint. Having two copies means a fix in one won't propagate. Consider removing one and calling the other.
… agent-name) Mirror of upstream Node MCP server fix in sreagent-runtime-extensibility-agents: 1. The SRE Agent skills data-plane endpoint expects the request body property to be 'skillContent', not 'content'. Sending 'content' causes the create call to fail. Renamed SreSkillProperties.Content -> SkillContent so the CamelCase JsonContext serializes it as 'skillContent' on the wire. 2. The create endpoint does not support the 'agentName' property. Dropped --agent-name option (and SkillAgentName / SkillAgentNameName definitions), the AgentName property on SreSkillProperties / SkillsCreateOptions, and all corresponding bindings in SkillsCreateCommand. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Server-side ExtendedAgentView exposes 'handoffDescription' as the sub-agent's description on the agent canvas. There is no plain 'description' field on sub-agents — sending one is silently dropped by the data plane. Renamed SreSubAgentProperties.Description -> HandoffDescription so the CamelCase JsonContext serializes it as 'handoffDescription' on the wire. Updated AgentsCreateCommand to populate the renamed field. The --description CLI option is unchanged on the command surface. Common Prompts tools (commonprompts list/get/create) are not yet ported to this PR; they should be added as a separate group when porting Sub-agent D. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ed pattern; add Common Prompts command group Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…entName from SreSkill Parity with sreagent-runtime commit 6837855f. The Node SkillSummary type was simplified to read description from properties.* envelope only; the C# SreSkill mirror still carried unused top-level Description/AgentName that were never populated by the v2 envelope responses. No callers reference them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Scaffolds
Azure.Mcp.Tools.SreAgent, the new tool package for Azure SRE Agent. This is a draft — only area registration + one read-onlyagents listplaceholder command. The full set of SRE Agent tools (agents/skills/connectors/threads/hooks/scheduled-tasks/incidents/knowledge-memory/documentation/workflows/architecture-planning) will land as follow-up commits on this branch.Tracks: #2541
[ONBOARD] Azure SRE Agent Tools(cc @g2vinay)What this PR does
tools/Azure.Mcp.Tools.SreAgent/src/following the standardAzure.Mcp.Tools.<Service>pattern (mirrorsAzure.Mcp.Tools.Acr/Azure.Mcp.Tools.ResourceHealth):Azure.Mcp.Tools.SreAgent.csproj(AOT-compatible)SreAgentSetup.cs(IAreaSetup) registering thesreagentarea +agentssubgroupCommands/SreAgentJsonContext.cs(AOT JSON source generation)Commands/BaseSreAgentCommand.cs(extendsSubscriptionCommand<T>)Commands/Agents/AgentsListCommand.cs(read-onlyReadOnly=true, Idempotent=true, Destructive=false)Models/,Options/,Services/skeletonsnew Azure.Mcp.Tools.SreAgent.SreAgentSetup()inservers/Azure.Mcp.Server/src/Program.csservers/Azure.Mcp.Server/Azure.Mcp.Server.slnxWhat's intentionally NOT in this PR (follow-up commits)
src/Agent/Agent.Cli/Services/ApiService.csin the SRE Agent runtime repo.tests/Azure.Mcp.Tools.SreAgent.UnitTests/)Direction (resolved upstream — leaving here as design record)
SubscriptionCommand<T>is the right base for all groups, including per-agent operations (threads, incidents). Subscription + resource group + agent name resolves the target.azmcp sreagent .... Matches existingresourcehealth/appserviceconvention.Local validation
I do not have SDK 10.0.201 locally (have 10.0.107); relying on PR CI for the build signal. Will iterate if CI flags issues.