Examples and workflows
Practical multi-step workflows showing how AI agents combine the ArgoCD MCP Server tools to onboard repositories, preview diffs, deploy applications, diagnose Degraded workloads, and execute rollbacks.
1. Repository onboarding
Onboard our GitHub repository https://github.com/myorg/payment-service to ArgoCD and verify the connection.
| Step | Tool Invoked | Action |
|---|---|---|
| 1 | Environment check | Confirms GIT_PASSWORD or SSH_PRIVATE_KEY_PATH is configured on the server |
| 2 | validate_repository_connection | Tests reachability and authentication against the repository URL |
| 3 | onboard_repository_https | Registers the repository in ArgoCD using server-side credentials |
| 4 | get_repository | Confirms connection status is Successful |
2. Diff-first application deployment
Create and deploy the payment-service application from https://github.com/myorg/payment-service (path: k8s/overlays/prod) to the production namespace, but show me the diff before syncing.
| Step | Tool Invoked | Action |
|---|---|---|
| 1 | create_application | Registers the Application resource without triggering an immediate sync |
| 2 | get_application_diff | Renders the desired manifests and computes the diff against live cluster state |
| 3 | sync_application | Executes the synchronization after operator confirmation |
| 4 | get_sync_status | Polls sync progress until phase reaches Succeeded |
| 5 | get_application_details | Verifies all child resources report Synced and Healthy |
3. Debugging a degraded application
My application payment-service is showing Degraded in production. Investigate the pods, logs, and events and tell me the root cause.
| Step | Tool Invoked | Finding |
|---|---|---|
| 1 | get_application_details | Identifies 1 of 3 Deployment pods stuck in CrashLoopBackOff |
| 2 | get_application_logs | Extracts 15 database connection timeout errors (MySQL connection refused on port 3306) |
| 3 | get_application_events | Confirms readiness probe failures on /healthz/db |
Example synthesized diagnosis:
Application Status: DEGRADED (payment-service)
- Unhealthy Resource: Deployment/payment-service (2/3 replicas ready)
- Error Pattern: 15x "dial tcp 10.96.42.18:3306: connect: connection refused" in the last 5m
- Root Cause: Downstream MySQL service is unreachable or blocked by NetworkPolicy
Recommended Remediation:
1. Verify mysql-primary StatefulSet readiness in the data namespace.
2. Check NetworkPolicy rules allowing egress from payment-service to port 3306.
3. Validate database host/port keys in the payment-db-credentials Secret.
4. Emergency rollback workflow
The latest deployment of checkout-service is failing health checks. Preview the diff and roll back to the previous working revision immediately.
| Step | Tool Invoked | Action |
|---|---|---|
| 1 | get_application_details | Inspects revision history (rev 14 failed → rev 13 last stable) |
| 2 | get_application_diff | Previews the manifest changes between rev 14 and rev 13 |
| 3 | update_application | Temporarily disables automated sync so ArgoCD does not re-apply HEAD |
| 4 | rollback_to_revision | Rolls the application back to revision 13 |
| 5 | get_sync_status & get_application_logs | Confirms pods recover to Healthy with zero error logs |
When an application has automated sync (selfHeal: true) enabled, ArgoCD blocks manual rollbacks unless auto-sync is disabled first. The agent automatically disables auto-sync via update_application before invoking rollback_to_revision.
Quick intent-to-tool mapping
| Operational Intent | Primary Tools | Example Prompt |
|---|---|---|
| Onboard a repository | validate_repository_connection, onboard_repository_https | "Add repo https://github.com/org/app to ArgoCD" |
| Configure multi-tenancy | create_project, generate_project_manifest | "Create an AppProject for the payments team scoped to payments-* namespaces" |
| Preview & deploy | get_application_diff, sync_application | "Show me the diff for frontend-app and sync with dry_run=true" |
| Refresh & prune | hard_refresh, prune_resources | "Force a hard refresh on api-gateway and prune orphaned resources" |
| Diagnose failures | get_application_details, get_application_logs, get_application_events | "Why is billing-worker OutOfSync and Degraded?" |
| Export GitOps YAML | generate_project_manifest, generate_repository_secret_manifest | "Generate the declarative AppProject and Secret YAML for Git" |