Skip to main content

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.

StepTool InvokedAction
1Environment checkConfirms GIT_PASSWORD or SSH_PRIVATE_KEY_PATH is configured on the server
2validate_repository_connectionTests reachability and authentication against the repository URL
3onboard_repository_httpsRegisters the repository in ArgoCD using server-side credentials
4get_repositoryConfirms 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.

StepTool InvokedAction
1create_applicationRegisters the Application resource without triggering an immediate sync
2get_application_diffRenders the desired manifests and computes the diff against live cluster state
3sync_applicationExecutes the synchronization after operator confirmation
4get_sync_statusPolls sync progress until phase reaches Succeeded
5get_application_detailsVerifies 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.

StepTool InvokedFinding
1get_application_detailsIdentifies 1 of 3 Deployment pods stuck in CrashLoopBackOff
2get_application_logsExtracts 15 database connection timeout errors (MySQL connection refused on port 3306)
3get_application_eventsConfirms 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.

StepTool InvokedAction
1get_application_detailsInspects revision history (rev 14 failed → rev 13 last stable)
2get_application_diffPreviews the manifest changes between rev 14 and rev 13
3update_applicationTemporarily disables automated sync so ArgoCD does not re-apply HEAD
4rollback_to_revisionRolls the application back to revision 13
5get_sync_status & get_application_logsConfirms 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 IntentPrimary ToolsExample Prompt
Onboard a repositoryvalidate_repository_connection, onboard_repository_https"Add repo https://github.com/org/app to ArgoCD"
Configure multi-tenancycreate_project, generate_project_manifest"Create an AppProject for the payments team scoped to payments-* namespaces"
Preview & deployget_application_diff, sync_application"Show me the diff for frontend-app and sync with dry_run=true"
Refresh & prunehard_refresh, prune_resources"Force a hard refresh on api-gateway and prune orphaned resources"
Diagnose failuresget_application_details, get_application_logs, get_application_events"Why is billing-worker OutOfSync and Degraded?"
Export GitOps YAMLgenerate_project_manifest, generate_repository_secret_manifest"Generate the declarative AppProject and Secret YAML for Git"