Repository navigation
Add read-only health tool to MCP server - #70527
Conversation
Expose workflow health JSON with named filters and read-only annotations. Include health in generated MCP configurations and return JSON for empty health summaries. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🔬 Test Quality Sentinel is analyzing test quality on this pull request... |
|
✂️ Ponytail Reviewer has started processing this pull request |
|
🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills... |
|
🔍 Design Decision Gate 🏗️ is checking for design decision records on this pull request... |
|
🔎 PR Code Quality Reviewer is reviewing code quality for this pull request... |
There was a problem hiding this comment.
🟡 Changes recommended
Default MCP behavior and integration-test expectations contain unresolved correctness issues.
3 open issues
What changed in this PR
Exposes existing workflow health reports through a read-only MCP tool so agents can inspect execution and recovery evidence.
Changes:
- Adds health-tool arguments, execution, and read-only annotations.
- Updates MCP registration, default configuration, and documentation.
- Adds regression coverage and valid JSON for empty summaries.
| File | Description |
|---|---|
pkg/cli/mcp_tools_health.go |
Implements the health tool. |
pkg/cli/mcp_tools_health_test.go |
Tests arguments, errors, and schema. |
pkg/cli/mcp_server.go |
Registers health. |
pkg/cli/mcp_server_unit_test.go |
Updates discovery expectations. |
pkg/cli/mcp_server_tools_test.go |
Updates integration discovery expectations. |
pkg/cli/mcp_server_command.go |
Adds health to command help. |
pkg/cli/mcp_config_file.go |
Enables health in default configuration. |
pkg/cli/mcp_config_file_test.go |
Updates configuration expectations. |
pkg/cli/mcp_argument_validation.go |
Registers health parameters. |
pkg/cli/mcp_argument_validation_test.go |
Updates parameter-registry expectations. |
pkg/cli/init_mcp_test.go |
Updates initialization expectations. |
pkg/cli/health_command.go |
Emits JSON for empty summaries. |
pkg/cli/health_command_test.go |
Covers empty-summary JSON. |
docs/src/content/docs/reference/gh-aw-as-mcp-server.md |
Documents health availability and options. |
Review effort: Max
|
|
||
| // Verify expected tools are present | ||
| expectedTools := []string{"status", "compile", "logs", "audit", "audit-diff", "checks", "mcp-inspect", "work-queue", "add", "update", "fix"} | ||
| expectedTools := []string{"status", "health", "compile", "logs", "audit", "audit-diff", "checks", "mcp-inspect", "work-queue", "add", "update", "fix"} |
| if args.Threshold != nil { | ||
| cmdArgs = append(cmdArgs, "--threshold="+strconv.FormatFloat(*args.Threshold, 'f', -1, 64)) | ||
| } | ||
| for _, option := range []struct{ flag, value string }{ |
| {"start-date", args.StartDate}, | ||
| {"end-date", args.EndDate}, | ||
| {"repo", args.Repo}, | ||
| {"logs-dir", args.LogsDir}, |
|
🎉 This pull request is included in a new release. Release: |

Expose workflow health reports to MCP clients so agents can inspect success rates, execution trends, and revision-aware recovery evidence without write access.
Changes
healthtool wrappinggh aw health --json, with named workflow, time-window, threshold, repository, and existing-log-cache options.Validation
Targeted health and MCP regression tests, MCP tool-discovery integration, build, formatting, and incremental Go lint passed. The full
make agent-report-progressgate did not pass because of a shared golangci-lint lock and pre-existing custom-linter findings inmcp_argument_validation.go. A separate incremental golangci-lint run reported no new issues, and custom lint reported no health-specific findings.