Skip to main content
Glama
akuity
by akuity

sync_application

Syncs application configurations specified by 'applicationName' in ArgoCD MCP server to ensure consistent and accurate deployment states.

Instructions

sync_application syncs application

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applicationNameYes

Implementation Reference

  • Tool handler for 'sync_application', constructs sync options and delegates to ArgoCD client.
    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 input schema defining 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"])' ) },
  • Registers the 'sync_application' tool using addJsonOutputTool helper with name, description, schema, and handler.
    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 ); } );
  • Core implementation of application sync via ArgoCD API POST to /sync endpoint.
    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; }

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