Skip to content

[Draft] Add Azure.Mcp.Tools.SreAgent (scaffolding for issue #2541)#2611

Open
BandaruDheeraj wants to merge 10 commits intomainfrom
bandarud/sre-agent-tools
Open

[Draft] Add Azure.Mcp.Tools.SreAgent (scaffolding for issue #2541)#2611
BandaruDheeraj wants to merge 10 commits intomainfrom
bandarud/sre-agent-tools

Conversation

@BandaruDheeraj
Copy link
Copy Markdown

@BandaruDheeraj BandaruDheeraj commented May 8, 2026

Summary

Scaffolds Azure.Mcp.Tools.SreAgent, the new tool package for Azure SRE Agent. This is a draft — only area registration + one read-only agents list placeholder 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

  • Adds tools/Azure.Mcp.Tools.SreAgent/src/ following the standard Azure.Mcp.Tools.<Service> pattern (mirrors Azure.Mcp.Tools.Acr / Azure.Mcp.Tools.ResourceHealth):
    • Azure.Mcp.Tools.SreAgent.csproj (AOT-compatible)
    • SreAgentSetup.cs (IAreaSetup) registering the sreagent area + agents subgroup
    • Commands/SreAgentJsonContext.cs (AOT JSON source generation)
    • Commands/BaseSreAgentCommand.cs (extends SubscriptionCommand<T>)
    • Commands/Agents/AgentsListCommand.cs (read-only ReadOnly=true, Idempotent=true, Destructive=false)
    • Models/, Options/, Services/ skeletons
  • Registers new Azure.Mcp.Tools.SreAgent.SreAgentSetup() in servers/Azure.Mcp.Server/src/Program.cs
  • Adds slnx folder + project entries in servers/Azure.Mcp.Server/Azure.Mcp.Server.slnx

What's intentionally NOT in this PR (follow-up commits)

  • Full Services implementation (the placeholder returns an empty list). Will port the SRE Agent REST surface from src/Agent/Agent.Cli/Services/ApiService.cs in the SRE Agent runtime repo.
  • Remaining ~30 commands across the 11 tool groups listed above
  • Unit tests project (tests/Azure.Mcp.Tools.SreAgent.UnitTests/)
  • Live tests
  • README + CHANGELOG entries

Direction (resolved upstream — leaving here as design record)

  1. Auth → Use the standard Azure.Mcp credential pipeline as-is. No service-specific credential path.
  2. Subscription scopingSubscriptionCommand<T> is the right base for all groups, including per-agent operations (threads, incidents). Subscription + resource group + agent name resolves the target.
  3. Subcommand nameazmcp sreagent .... Matches existing resourcehealth/appservice convention.
  4. Endpoint → Match the SRE Agent Node MCP server feature parity. That server hits the SRE Agent REST data plane directly (not just ARM), so the C# Services layer must call the data-plane endpoint of each agent resource. ARM is used to enumerate/locate the agent resource; per-resource calls then go to the agent's data-plane URL.

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.

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>
Dheeraj Bandaru and others added 5 commits May 8, 2026 14:08
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>
@BandaruDheeraj BandaruDheeraj marked this pull request as ready for review May 8, 2026 22:11
@BandaruDheeraj BandaruDheeraj requested review from a team as code owners May 8, 2026 22:11
@BandaruDheeraj
Copy link
Copy Markdown
Author

@g2vinay this is now ready for review.

Summary:

  • New tool group: Azure.Mcp.Tools.SreAgent (issue [ONBOARD] Azure SRE Agent Tools #2541)
  • ~48 commands across 11 sub-groups: agents, skills, connectors, hooks, threads, scheduledtasks, incidents, workflows, docs, architecture, memories
  • ARM enumeration of Microsoft.App/SREAgentPreview via Resource Graph + data-plane HTTP via CallDataPlaneAsync (token audience https://azuresre.dev/.default)
  • New UnitTests project (xunit.v3 + NSubstitute) — all green
  • Added to Microsoft.Mcp.slnx, servers/Azure.Mcp.Server/README.md, and changelog-entries/
  • Full Azure.Mcp.Server build green

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 #region (sub-agent X) block markers. Happy to address any feedback or split into smaller PRs if preferred.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.SreAgent tool project with commands, options, models, JSON source-gen context, and an ISreAgentService + implementation for ARM discovery and SRE Agent data-plane calls.
  • Registered the new sreagent area in Azure.Mcp.Server and 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;
Comment on lines +42 to +57
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"
Comment on lines +1 to +4
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."
Comment on lines +115 to +119
tools.AddCommand<AgentToolsListCommand>(serviceProvider);
tools.AddCommand<AgentsToolsGetCommand>(serviceProvider);
tools.AddCommand<AgentsToolsCreateCommand>(serviceProvider);
tools.AddCommand<SkillsDeleteCommand>(serviceProvider);

Comment on lines +152 to +162
// 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;
Copy link
Copy Markdown
Contributor

@jongio jongio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Dheeraj Bandaru and others added 4 commits May 9, 2026 11:26
… 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

3 participants