Skip to main content
Glama
akuity
by akuity

sync_application

Sync ArgoCD applications to deploy configurations from source repositories. Specify namespace for non-default applications, use dry runs for testing, and prune removed resources.

Instructions

sync_application syncs application. Specify applicationNamespace if the application is in a non-default namespace to avoid permission errors.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applicationNameYes
applicationNamespaceNoThe namespace where the application is located. Required if application is not in the default namespace.
dryRunNoPerform a dry run sync without applying changes
pruneNoRemove resources that are no longer defined in the source
revisionNoSync to a specific revision instead of the latest
syncOptionsNoAdditional sync options (e.g., ["CreateNamespace=true", "PrunePropagationPolicy=foreground"])

Implementation Reference

  • Core handler function that executes the sync logic by constructing the sync request and making the API call to ArgoCD.
    public async syncApplication( applicationName: string, options?: { appNamespace?: string; dryRun?: boolean; prune?: boolean; revision?: string; syncOptions?: string[]; } ) { const syncRequest: Record<string, string | boolean | string[]> = {}; if (options?.appNamespace) { syncRequest.appNamespace = options.appNamespace; } if (options?.dryRun !== undefined) { syncRequest.dryRun = options.dryRun; } if (options?.prune !== undefined) { syncRequest.prune = options.prune; } if (options?.revision) { syncRequest.revision = options.revision; } if (options?.syncOptions) { syncRequest.syncOptions = options.syncOptions; } const { body } = await this.client.post<V1alpha1Application, V1alpha1Application>( `/api/v1/applications/${applicationName}/sync`, null, Object.keys(syncRequest).length > 0 ? syncRequest : undefined ); return body; }
  • Registers the MCP tool 'sync_application' with description, input schema, and execution callback that delegates to ArgoCDClient.
    this.addJsonOutputTool( 'sync_application', 'sync_application syncs application. Specify applicationNamespace if the application is in a non-default namespace to avoid permission errors.', { applicationName: z.string(), applicationNamespace: ApplicationNamespaceSchema.optional().describe( 'The namespace where the application is located. Required if application is not in the default namespace.' ), dryRun: z .boolean() .optional() .describe('Perform a dry run sync without applying changes'), prune: z .boolean() .optional() .describe('Remove resources that are no longer defined in the source'), revision: z .string() .optional() .describe('Sync to a specific revision instead of the latest'), syncOptions: z .array(z.string()) .optional() .describe( 'Additional sync options (e.g., ["CreateNamespace=true", "PrunePropagationPolicy=foreground"])' ) }, async ({ applicationName, applicationNamespace, dryRun, prune, revision, syncOptions }) => { const options: Record<string, string | boolean | string[]> = {}; if (applicationNamespace) options.appNamespace = applicationNamespace; if (dryRun !== undefined) options.dryRun = dryRun; if (prune !== undefined) options.prune = prune; if (revision) options.revision = revision; if (syncOptions) options.syncOptions = syncOptions; return await this.argocdClient.syncApplication( applicationName, Object.keys(options).length > 0 ? options : undefined ); } );
  • Zod schema defining the input parameters for the sync_application tool.
    { applicationName: z.string(), applicationNamespace: ApplicationNamespaceSchema.optional().describe( 'The namespace where the application is located. Required if application is not in the default namespace.' ), dryRun: z .boolean() .optional() .describe('Perform a dry run sync without applying changes'), prune: z .boolean() .optional() .describe('Remove resources that are no longer defined in the source'), revision: z .string() .optional() .describe('Sync to a specific revision instead of the latest'), syncOptions: z .array(z.string()) .optional() .describe( 'Additional sync options (e.g., ["CreateNamespace=true", "PrunePropagationPolicy=foreground"])' ) },
  • Shared Zod schema for application namespace used in sync_application input.
    export const ApplicationNamespaceSchema = z .string() .min(1) .describe( `The namespace where the ArgoCD application resource will be created. This is the namespace of the Application resource itself, not the destination namespace for the application's resources. You can specify any valid Kubernetes namespace (e.g., 'argocd', 'argocd-apps', 'my-namespace', etc.). The default ArgoCD namespace is typically 'argocd', but you can use any namespace you prefer.` );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/akuity/argocd-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server